https://gcc.gnu.org/g:f5224caf53a4f17b190497c00c505977d358bef9

commit r15-4389-gf5224caf53a4f17b190497c00c505977d358bef9
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Oct 16 17:45:19 2024 +0200

    c: Fix up uninitialized next.original_type use in #embed optimization
    
    Jonathan pointed me at a diagnostic from an unnamed static analyzer
    which found that next.original_type isn't initialized for the CPP_EMBED
    case when it is parsed in a comma expression, yet
      expr.original_type = next.original_type;
    is done a few lines later and the expr is returned.
    
    2024-10-16  Jakub Jelinek  <ja...@redhat.com>
    
            * c-parser.cc (c_parser_expression): Initialize next.original_type
            to integer_type_node for the CPP_EMBED case.

Diff:
---
 gcc/c/c-parser.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 120f2b289c0b..e4381044e5cb 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -13299,6 +13299,7 @@ c_parser_expression (c_parser *parser)
          next.value = build_int_cst (TREE_TYPE (val),
                                      ((const unsigned char *)
                                       RAW_DATA_POINTER (val))[last]);
+         next.original_type = integer_type_node;
          c_parser_consume_token (parser);
        }
       else

Reply via email to