re PR c/91192 (non-deterministic ICE on invalid)
authorJakub Jelinek <jakub@redhat.com>
Wed, 31 Jul 2019 14:32:24 +0000 (16:32 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 31 Jul 2019 14:32:24 +0000 (16:32 +0200)
PR c/91192
* c-parser.c (c_parser_sizeof_expression): Call set_c_expr_source_range
even if finish is UNKNOWN_LOCATION, just use start as finish in that
case.

From-SVN: r273935

gcc/c/ChangeLog
gcc/c/c-parser.c

index d07051b15a360c8bd96fcefa17b36b9a6bb2166a..18c4e413e2d38ef5c55400738ba1acdc120c5041 100644 (file)
@@ -1,3 +1,10 @@
+2019-07-31  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/91192
+       * c-parser.c (c_parser_sizeof_expression): Call set_c_expr_source_range
+       even if finish is UNKNOWN_LOCATION, just use start as finish in that
+       case.
+
 2019-07-25  Martin Liska  <mliska@suse.cz>
            Dominik Infuhr  <dominik.infuehr@theobroma-systems.com>
 
index 67210493c7e3bb5f52fd77943ae9d05325abe87f..c7c13a6d9ae3c2fa7f12ae0d6ecbd6244cd9f189 100644 (file)
@@ -7477,8 +7477,9 @@ c_parser_sizeof_expression (c_parser *parser)
        error_at (expr_loc, "%<sizeof%> applied to a bit-field");
       result = c_expr_sizeof_expr (expr_loc, expr);
     }
-  if (finish != UNKNOWN_LOCATION)
-    set_c_expr_source_range (&result, start, finish);
+  if (finish == UNKNOWN_LOCATION)
+    finish = start;
+  set_c_expr_source_range (&result, start, finish);
   return result;
 }