diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-22 22:04:02 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-22 22:04:02 +0000 |
commit | 380058da61e088b67672bbb3ca19493d77c299e3 (patch) | |
tree | e97c6dc1cd26ceb0445f326cf93f611f9fd6d214 /gcc/c-parse.in | |
parent | dedcedfe062fd5a9d16d04d54a0d376ae3e6c708 (diff) | |
download | gcc-380058da61e088b67672bbb3ca19493d77c299e3.tar.gz |
* c-parse.in (expr_no_commas): Verify we've an expr before
calling C_SET_EXP_ORIGINAL_CODE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26590 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 9aac25694a4..c8ff12de753 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -604,12 +604,22 @@ expr_no_commas: { 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); - C_SET_EXP_ORIGINAL_CODE ($$, MODIFY_EXPR); } + { char class; + $$ = build_modify_expr ($1, NOP_EXPR, $3); + class = TREE_CODE_CLASS (TREE_CODE ($$)); + if (class == 'e' || class == '1' + || class == '2' || class == '<') + C_SET_EXP_ORIGINAL_CODE ($$, MODIFY_EXPR); + } | expr_no_commas ASSIGN expr_no_commas - { $$ = build_modify_expr ($1, $2, $3); + { char class; + $$ = build_modify_expr ($1, $2, $3); /* This inhibits warnings in truthvalue_conversion. */ - C_SET_EXP_ORIGINAL_CODE ($$, ERROR_MARK); } + class = TREE_CODE_CLASS (TREE_CODE ($$)); + if (class == 'e' || class == '1' + || class == '2' || class == '<') + C_SET_EXP_ORIGINAL_CODE ($$, ERROR_MARK); + } ; primary: |