re PR java/4489 (bytecode generation endless loop with certain switch() exprs)

Fix for PR java/4489:
	* jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
	force a new label when computing `body_block'.

From-SVN: r46092
This commit is contained in:
Tom Tromey 2001-10-08 20:35:03 +00:00 committed by Tom Tromey
parent 5a2ce672ba
commit f3ca28bffb
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2001-10-08 Tom Tromey <tromey@redhat.com>
Fix for PR java/4489:
* jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
force a new label when computing `body_block'.
2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* jcf-io.c (format_uint): Const-ify.

View File

@ -1483,7 +1483,7 @@ generate_bytecode_insns (exp, target, state)
}
}
break;
case COMPOUND_EXPR:
case COMPOUND_EXPR:
generate_bytecode_insns (TREE_OPERAND (exp, 0), IGNORE_TARGET, state);
generate_bytecode_insns (TREE_OPERAND (exp, 1), target, state);
break;
@ -1701,7 +1701,9 @@ generate_bytecode_insns (exp, target, state)
sw_state.default_label = NULL;
generate_bytecode_insns (TREE_OPERAND (exp, 0), STACK_TARGET, state);
expression_last = state->last_block;
body_block = get_jcf_label_here (state); /* Force a new block here. */
/* Force a new block here. */
body_block = gen_jcf_label (state);
define_jcf_label (body_block, state);
generate_bytecode_insns (TREE_OPERAND (exp, 1), IGNORE_TARGET, state);
body_last = state->last_block;