+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.
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))
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;