java/5794: gcj fails to verify .class file generated by Sun JDK 1.4 compiler

Per Bothner per@bothner.com
Wed Sep 11 10:45:00 GMT 2002


Eric Blake wrote:
> [An exception handler not being outside the range of the covered code]
 > does have useful meaning, and JDK 1.4.0 and above, as well as jikes
> 1.16 and above, now generate such bytecode. Sun has recently begun to 
> insist that with the synchronized statement, that ALL possible 
> instructions until a monitorexit has successfully executed be covered by 
> a handler.  This is because an asynchronous exception might occur, but 
> the compiler must guarantee that no exception can interrupt the release 
> of the monitor.  In short, Sun no longer follows the 2nd bullet of JVMS 
> 4.9.5.

I don't get this.  First, the testcases in question don't have any
synchronization, so I don't see the relevance.  Secondly. I find it
hard to see how an exception handler that handles itself makes the
code more robust and safe.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Java-patches mailing list