verify.cc (_Jv_BytecodeVerifier::branch_prepass): Uses two operand bytes, not one.

* verify.cc (_Jv_BytecodeVerifier::branch_prepass) [op_iinc]:
	Uses two operand bytes, not one.
	[op_arraylength]: Has no operands in bytecode.
	(_Jv_BytecodeVerifier::push_jump): Fixed call to
	check_no_uninitialized_objects.
	(_Jv_BytecodeVerifier::push_exception_jump): Likewise.
	(_Jv_BytecodeVerifier::handle_ret_insn): Likewise.
	(_Jv_BytecodeVerifier::handle_jsr_insn): Likewise.

From-SVN: r47202
This commit is contained in:
Tom Tromey 2001-11-20 05:16:17 +00:00 committed by Tom Tromey
parent 78a40378a9
commit 8051c3d633
2 changed files with 15 additions and 6 deletions

View file

@ -1,5 +1,14 @@
2001-11-19 Tom Tromey <tromey@redhat.com> 2001-11-19 Tom Tromey <tromey@redhat.com>
* verify.cc (_Jv_BytecodeVerifier::branch_prepass) [op_iinc]:
Uses two operand bytes, not one.
[op_arraylength]: Has no operands in bytecode.
(_Jv_BytecodeVerifier::push_jump): Fixed call to
check_no_uninitialized_objects.
(_Jv_BytecodeVerifier::push_exception_jump): Likewise.
(_Jv_BytecodeVerifier::handle_ret_insn): Likewise.
(_Jv_BytecodeVerifier::handle_jsr_insn): Likewise.
* verify.cc (_Jv_BytecodeVerifier::require_array_type): Special * verify.cc (_Jv_BytecodeVerifier::require_array_type): Special
case for boolean arrays. case for boolean arrays.

View file

@ -1037,13 +1037,13 @@ private:
{ {
int npc = compute_jump (offset); int npc = compute_jump (offset);
if (npc < PC) if (npc < PC)
current_state->check_no_uninitialized_objects (current_method->max_stack); current_state->check_no_uninitialized_objects (current_method->max_locals);
push_jump_merge (npc, current_state); push_jump_merge (npc, current_state);
} }
void push_exception_jump (type t, int pc) void push_exception_jump (type t, int pc)
{ {
current_state->check_no_uninitialized_objects (current_method->max_stack, current_state->check_no_uninitialized_objects (current_method->max_locals,
true); true);
state s (current_state, current_method->max_stack, state s (current_state, current_method->max_stack,
current_method->max_locals); current_method->max_locals);
@ -1114,7 +1114,7 @@ private:
// in the enclosing context. // in the enclosing context.
current_state->subroutine = get_subroutine (subr->pc); current_state->subroutine = get_subroutine (subr->pc);
if (subr->pc < PC) if (subr->pc < PC)
current_state->check_no_uninitialized_objects (current_method->max_stack); current_state->check_no_uninitialized_objects (current_method->max_locals);
push_jump_merge (subr->pc, current_state, true); push_jump_merge (subr->pc, current_state, true);
} }
@ -1139,7 +1139,7 @@ private:
int npc = compute_jump (offset); int npc = compute_jump (offset);
if (npc < PC) if (npc < PC)
current_state->check_no_uninitialized_objects (current_method->max_stack); current_state->check_no_uninitialized_objects (current_method->max_locals);
check_nonrecursive_call (current_state->subroutine, npc); check_nonrecursive_call (current_state->subroutine, npc);
// Temporarily modify the current state so that it looks like we are // Temporarily modify the current state so that it looks like we are
@ -1344,7 +1344,6 @@ private:
case op_lneg: case op_lneg:
case op_fneg: case op_fneg:
case op_dneg: case op_dneg:
case op_iinc:
case op_i2l: case op_i2l:
case op_i2f: case op_i2f:
case op_i2d: case op_i2d:
@ -1371,6 +1370,7 @@ private:
case op_areturn: case op_areturn:
case op_return: case op_return:
case op_athrow: case op_athrow:
case op_arraylength:
break; break;
case op_bipush: case op_bipush:
@ -1385,12 +1385,12 @@ private:
case op_fstore: case op_fstore:
case op_dstore: case op_dstore:
case op_astore: case op_astore:
case op_arraylength:
case op_ret: case op_ret:
case op_newarray: case op_newarray:
get_byte (); get_byte ();
break; break;
case op_iinc:
case op_sipush: case op_sipush:
case op_ldc_w: case op_ldc_w:
case op_ldc2_w: case op_ldc2_w: