javac generates unverifiable initializer for nested subclass of local class.
Jeremy Manson
jeremymanson at google.com
Mon Aug 19 12:49:45 PDT 2013
Thanks!
Jeremy
On Fri, Aug 16, 2013 at 2:37 AM, Vicente-Arturo Romero-Zaldivar <
vicente.romero at oracle.com> wrote:
> Hi Jeremy,
>
> This bug has been fixed:
> http://hg.openjdk.java.net/jdk8/tl/langtools/rev/a6378c19836b
>
> Thanks for your report,
>
>
> 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/20130819/a916808d/attachment.html
More information about the compiler-dev
mailing list