summaryrefslogtreecommitdiff
path: root/gcc/c-parse.in
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1997-03-17 18:46:42 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1997-03-17 18:46:42 +0000
commita41887adad049cbb54f6f6bf260bad55c6f2757d (patch)
treec5b086bf5900c6d02d0eb34abd71f691494bda3d /gcc/c-parse.in
parent90b8793d9b1c0e8add756a5d8c1cf67541efb161 (diff)
downloadgcc-a41887adad049cbb54f6f6bf260bad55c6f2757d.tar.gz
(expr_no_commas): Do not store temporary skip_evaluation increments on
yacc value stack; the code was buggy and occasionally wrote past the end of the stack. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13720 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r--gcc/c-parse.in26
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 2a40c5a3ce0..e395f86670e 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -1,5 +1,5 @@
/* YACC parser for C syntax and for Objective C. -*-c-*-
- Copyright (C) 1987, 88, 89, 92-5, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-6, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -577,27 +577,24 @@ expr_no_commas:
{ $$ = parser_build_binary_op ($2, $1, $3); }
| expr_no_commas ANDAND
{ $1 = truthvalue_conversion (default_conversion ($1));
- $<itype>2 = $1 == boolean_false_node;
- skip_evaluation += $<itype>2; }
+ skip_evaluation += $1 == boolean_false_node; }
expr_no_commas
- { skip_evaluation -= $<itype>2;
+ { skip_evaluation -= $1 == boolean_false_node;
$$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $4); }
| expr_no_commas OROR
{ $1 = truthvalue_conversion (default_conversion ($1));
- $<itype>3 = $1 == boolean_true_node;
- skip_evaluation += $<itype>3; }
+ skip_evaluation += $1 == boolean_true_node; }
expr_no_commas
- { skip_evaluation -= $<itype>3;
+ { skip_evaluation -= $1 == boolean_true_node;
$$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $4); }
| expr_no_commas '?'
{ $1 = truthvalue_conversion (default_conversion ($1));
- $<itype>3 = $1 == boolean_true_node;
- $<itype>2 = $1 == boolean_false_node;
- skip_evaluation += $<itype>2; }
+ skip_evaluation += $1 == boolean_false_node; }
expr ':'
- { skip_evaluation += $<itype>3 - $<itype>2; }
+ { skip_evaluation += (($1 == boolean_true_node)
+ - ($1 == boolean_false_node)); }
expr_no_commas
- { skip_evaluation -= $<itype>3;
+ { skip_evaluation -= $1 == boolean_true_node;
$$ = build_conditional_expr ($1, $4, $7); }
| expr_no_commas '?'
{ if (pedantic)
@@ -605,10 +602,9 @@ expr_no_commas:
/* Make sure first operand is calculated only once. */
$<ttype>2 = save_expr ($1);
$1 = truthvalue_conversion (default_conversion ($<ttype>2));
- $<itype>3 = $1 == boolean_true_node;
- skip_evaluation += $<itype>3; }
+ skip_evaluation += $1 == boolean_true_node; }
':' expr_no_commas
- { skip_evaluation -= $<itype>3;
+ { skip_evaluation -= $1 == boolean_true_node;
$$ = build_conditional_expr ($1, $<ttype>2, $5); }
| expr_no_commas '=' expr_no_commas
{ $$ = build_modify_expr ($1, NOP_EXPR, $3);