aboutsummaryrefslogtreecommitdiff
path: root/libjava/verify.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-19 00:31:37 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-19 00:31:37 +0000
commita5a42e04812a6eab9c68e9802936c396bd9cbc77 (patch)
treefca4c0afbe6be4db09f2e125e67db3f1fa699867 /libjava/verify.cc
parente066425dd70681b63d24e2c3dd78844ed478cb6e (diff)
* verify.cc (_Jv_BytecodeVerifier::pop_type): Put PC into error
message. (_Jv_BytecodeVerifier::pop64): Likewise. (_Jv_BytecodeVerifier::pop32): Likewise. (_Jv_BytecodeVerifier::pop_raw): Likewise. (_Jv_BytecodeVerifier::pop_type): Promote the match type. (type::set_initialized): Only modify uninitialized types. (type::set_uninitialized): Fix shadowing bug. Simplify code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47158 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/verify.cc')
-rw-r--r--libjava/verify.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 9917d0ccbf3..5d8fd809de7 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -353,20 +353,23 @@ private:
}
// Mark this type as the uninitialized result of `new'.
- void set_uninitialized (int pc)
+ void set_uninitialized (int npc)
{
- if (key != reference_type && key != unresolved_reference_type)
+ if (key == reference_type)
+ key = uninitialized_reference_type;
+ else if (key == unresolved_reference_type)
+ key = uninitialized_unresolved_reference_type;
+ else
verify_fail ("internal error in type::uninitialized");
- key = (key == reference_type
- ? uninitialized_reference_type
- : uninitialized_unresolved_reference_type);
- pc = pc;
+ pc = npc;
}
// Mark this type as now initialized.
void set_initialized (int npc)
{
- if (pc == npc)
+ if (npc != UNINIT && pc == npc
+ && (key == uninitialized_reference_type
+ || key == uninitialized_unresolved_reference_type))
{
key = (key == uninitialized_reference_type
? reference_type
@@ -834,11 +837,11 @@ private:
type pop_raw ()
{
if (current_state->stacktop <= 0)
- verify_fail ("stack empty");
+ verify_fail ("stack empty", start_PC);
type r = current_state->stack[--current_state->stacktop];
current_state->stackdepth -= r.depth ();
if (current_state->stackdepth < 0)
- verify_fail ("stack empty");
+ verify_fail ("stack empty", start_PC);
return r;
}
@@ -846,7 +849,7 @@ private:
{
type r = pop_raw ();
if (r.iswide ())
- verify_fail ("narrow pop of wide type");
+ verify_fail ("narrow pop of wide type", start_PC);
return r;
}
@@ -854,15 +857,16 @@ private:
{
type r = pop_raw ();
if (! r.iswide ())
- verify_fail ("wide pop of narrow type");
+ verify_fail ("wide pop of narrow type", start_PC);
return r;
}
type pop_type (type match)
{
+ match.promote ();
type t = pop_raw ();
if (! match.compatible (t))
- verify_fail ("incompatible type on stack");
+ verify_fail ("incompatible type on stack", start_PC);
return t;
}