diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-03 00:35:06 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-03 00:35:06 +0000 |
| commit | 467e3ec9bafb676c5eeda6d2c2af1613b0e18616 (patch) | |
| tree | 838c4b462be1965ca1ec669a6e685e99e218174a /gcc/java | |
| parent | 1665d1b961933f9dfe02c661e700b44ffb9d975f (diff) | |
| download | ppe42-gcc-467e3ec9bafb676c5eeda6d2c2af1613b0e18616.tar.gz ppe42-gcc-467e3ec9bafb676c5eeda6d2c2af1613b0e18616.zip | |
PR java/10459:
* parse.y (finish_for_loop): Do nothing if update expression is a
EXPR_WFL_NODE wrapping nothing.
(java_complete_lhs) <COMPOUND_EXPR>: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66411 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
| -rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/java/parse.y | 21 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 546e6790522..02e5075be53 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2003-05-01 Tom Tromey <tromey@redhat.com> + + PR java/10459: + * parse.y (finish_for_loop): Do nothing if update expression is a + EXPR_WFL_NODE wrapping nothing. + (java_complete_lhs) <COMPOUND_EXPR>: Likewise. + 2003-05-02 Nathan Sidwell <nathan@codesourcery.com> * lex.h (input_lineno): Remove declaration. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index c35d4e504aa..49fbc9162c0 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -11771,7 +11771,9 @@ java_complete_lhs (tree node) nn = wfl_op2; if (TREE_CODE (nn) == EXPR_WITH_FILE_LOCATION) nn = EXPR_WFL_NODE (nn); - if (TREE_CODE (nn) != EXIT_EXPR) + /* NN can be NULL_TREE exactly when UPDATE is, in + finish_for_loop. */ + if (nn != NULL_TREE && TREE_CODE (nn) != EXIT_EXPR) { SET_WFL_OPERATOR (wfl_operator, node, wfl_op2); if (SUPPRESS_UNREACHABLE_ERROR (nn)) @@ -14928,12 +14930,17 @@ finish_for_loop (int location, tree condition, tree update, tree body) tree up2 = update; if (TREE_CODE (up2) == EXPR_WITH_FILE_LOCATION) up2 = EXPR_WFL_NODE (up2); - /* Try to detect constraint violations. These would be - programming errors somewhere. */ - if (! IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (up2))) - || TREE_CODE (up2) == LOOP_EXPR) - abort (); - SUPPRESS_UNREACHABLE_ERROR (up2) = 1; + /* It is possible for the update expression to be an + EXPR_WFL_NODE wrapping nothing. */ + if (up2 != NULL_TREE && up2 != empty_stmt_node) + { + /* Try to detect constraint violations. These would be + programming errors somewhere. */ + if (! IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (up2))) + || TREE_CODE (up2) == LOOP_EXPR) + abort (); + SUPPRESS_UNREACHABLE_ERROR (up2) = 1; + } } LOOP_EXPR_BODY_UPDATE_BLOCK (LOOP_EXPR_BODY (loop)) = update; return loop; |

