This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
verifier problem
- From: Per Bothner <per at bothner dot com>
- To: tromey at redhat dot com
- Cc: java at gcc dot gnu dot org
- Date: Sat, 26 Jan 2002 11:27:17 -0800
- Subject: verifier problem
The attached problem, compiled by javac, causes a VerifyError when run
by gij. The problem appears a rather basic problem in how subroutines
are handled.
The comments at the bottom of the attachment is my notes from debugging
a more complex program, so aren't directly relevant to this test case.
I think (without having analyzed it too carefully) that trying to test
or set the subroutine field of a 'state' in merge is wrong. The
compile-time verifier has a corresponding 'merge_type_state" function,
and it does not set or test the sub-routine state. Instead, that is
done when processing the 'jsr' opcode Also, push pending block checks
for a transfer out of a subroutine.
I relatively recently had to implement a subroutine_nesting procedure
to check that we're finished with a subroutine.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
public class foo
{
static void f() { }
public static void main(String[] args)
{
try
{
f();
}
finally
{
try
{
f();
}
finally
{
f();
}
}
}
}
/*
push_exception_jump is called to signal trasfer from place in
exception range to handler.
push_exception_jump creates state, passes it to push_jump_merge
push_jump_merge calls states[handler_pc].merge(exception_state, ...)
merge sets states[handler_pc].subroutine to that to exception_state,
or (on sequencuent calls) fails. Both are wrong.
*/