aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-05-28 22:44:55 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-05-28 22:44:55 -0400
commit9d4e73d622b1033e0996064cd97ca6f577d85578 (patch)
tree894cbd2b84d691b0019824fddc32583a281303ab
parentd3b35d7584ef28d51bdf2a2fed49ba18c924fb81 (diff)
downloadgcc-9d4e73d622b1033e0996064cd97ca6f577d85578.zip
gcc-9d4e73d622b1033e0996064cd97ca6f577d85578.tar.gz
gcc-9d4e73d622b1033e0996064cd97ca6f577d85578.tar.bz2
(init...
(init, compstmt, stmt, all_iter_stmt_with_decl): If the lookahead token is a constant and we need to pop the momentary obstack, don't free it. From-SVN: r7382
-rw-r--r--gcc/c-parse.in33
1 files changed, 26 insertions, 7 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 9b1a77a..d3c6cad 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -1111,7 +1111,8 @@ init:
push_momentary (); }
initlist_maybe_comma '}'
{ $$ = pop_init_level (0);
- if ($$ == error_mark_node)
+ if ($$ == error_mark_node
+ && ! (yychar == STRING || yychar == CONSTANT))
pop_momentary ();
else
pop_momentary_nofree (); }
@@ -1551,17 +1552,26 @@ compstmt: '{' '}'
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), 1, 0);
$$ = poplevel (1, 1, 0);
- pop_momentary (); }
+ if (yychar == CONSTANT || yychar == STRING)
+ pop_momentary_nofree ();
+ else
+ pop_momentary (); }
| '{' pushlevel maybe_label_decls error '}'
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
$$ = poplevel (kept_level_p (), 0, 0);
- pop_momentary (); }
+ if (yychar == CONSTANT || yychar == STRING)
+ pop_momentary_nofree ();
+ else
+ pop_momentary (); }
| '{' pushlevel maybe_label_decls stmts '}'
{ emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), kept_level_p (), 0);
$$ = poplevel (kept_level_p (), 0, 0);
- pop_momentary (); }
+ if (yychar == CONSTANT || yychar == STRING)
+ pop_momentary_nofree ();
+ else
+ pop_momentary (); }
;
/* Value is number of statements counted as of the closeparen. */
@@ -1746,7 +1756,10 @@ stmt:
expand_loop_continue_here ();
if ($9)
c_expand_expr_stmt ($9);
- pop_momentary ();
+ if (yychar == CONSTANT || yychar == STRING)
+ pop_momentary_nofree ();
+ else
+ pop_momentary ();
expand_end_loop (); }
| SWITCH '(' expr ')'
{ stmt_count++;
@@ -1758,7 +1771,10 @@ stmt:
position_after_white_space (); }
lineno_labeled_stmt
{ expand_end_case ($3);
- pop_momentary (); }
+ if (yychar == CONSTANT || yychar == STRING)
+ pop_momentary_nofree ();
+ else
+ pop_momentary (); }
| BREAK ';'
{ stmt_count++;
emit_line_note ($<filename>-1, $<lineno>0);
@@ -1878,7 +1894,10 @@ all_iter_stmt_with_decl:
emit_line_note (input_filename, lineno);
expand_end_bindings (getdecls (), 1, 0);
$<ttype>$ = poplevel (1, 1, 0);
- pop_momentary ();
+ if (yychar == CONSTANT || yychar == STRING)
+ pop_momentary_nofree ();
+ else
+ pop_momentary ();
}
*/