This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.
*/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]