You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2020/05/28 20:40:00 UTC

[jira] [Updated] (GROOVY-9499) VerifyError when AIC used as argument to special constructor call

     [ https://issues.apache.org/jira/browse/GROOVY-9499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-9499:
--------------------------------
    Fix Version/s:     (was: 3.0.4)
                   3.0.0-rc-1

> VerifyError when AIC used as argument to special constructor call
> -----------------------------------------------------------------
>
>                 Key: GROOVY-9499
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9499
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Major
>             Fix For: 3.0.0-rc-1
>
>
> Consider the following:
> {code:groovy}
> class C {
>   C(ref) {
>     println ref.hashCode()
>   }
> }
> class D extends C {
>   D() {
>     super(new Object() { // AIC before special ctor call completes
>     })
>   }
> }
> new D()
> {code}
> Supplying an AIC to the super constructor results in a verify error for an uninitialized-this reference.  In this case, the AIC should not be built to expect a reference to an instance of the enclosing class since it is being executed in a static context.
> {code}
> Caught: java.lang.VerifyError: Bad type on operand stack
> Exception Details:
>   Location:
>     D.<init>()V @6: invokespecial
>   Reason:
>     Type uninitializedThis (current frame, stack[3]) is not assignable to 'D'
>   Current Frame:
>     bci: @6
>     flags: { flagThisUninit }
>     locals: { uninitializedThis }
>     stack: { uninitializedThis, uninitialized 1, uninitialized 1, uninitializedThis }
>   Bytecode:
>     0x0000000: 2abb 000d 592a b700 10b7 0013 b1 
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)