javac generates unverifiable initializer for nested subclass of local class.
Vicente-Arturo Romero-Zaldivar
vicente.romero at oracle.com
Thu Aug 1 02:16:34 PDT 2013
Hi Jeremy,
Thanks for the report, I filed the following bug entry to track this issue:
JDK-8022053: a bad type on operand stack exception is generated at
execution time for simple code
Vicente
On 01/08/13 07:36, Jeremy Manson wrote:
> Hi folks,
>
> I mentioned to a couple of people on the list that we have a some
> unreported bugs. In an effort to be better about reporting them, I'll
> mention this oldie but goodie that dates back to JDK 6 update 4.
>
> (I have to verify that each of them is still a bug, so this might be a
> trickle rather than a flood)
>
> public class TestTest {
> public static void main(final String args[]) {
> class NamedLocal {
> Object m() {
> return args;
> }
>
> class NamedLocalSub extends NamedLocal {}
> }
> new NamedLocal().new NamedLocalSub();
> }
> }
>
> With JDK8 b84:
>
> $ javac TestTest.java
> $ java TestTest
> Exception in thread "main" java.lang.VerifyError: Bad type on operand
> stack
> Exception Details:
> Location:
> TestTest$1NamedLocal$NamedLocalSub.<init>(LTestTest$1NamedLocal;)V @7:
> getfield
> Reason:
> Type uninitializedThis (current frame, stack[1]) is not assignable to
> 'TestTest$1NamedLocal$NamedLocalSub'
> Current Frame:
> bci: @7
> flags: { flagThisUninit }
> locals: { uninitializedThis, 'TestTest$1NamedLocal' }
> stack: { uninitializedThis, uninitializedThis }
> Bytecode:
> 0000000: 2a2b b500 012a 2ab4 0002 b700 03b1
>
> at TestTest.main(TestTest.java:10)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20130801/d07d715a/attachment.html
More information about the compiler-dev
mailing list