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

Eric Holley updated GROOVY-9704:
--------------------------------
    Description: 
The following code:
{code:java}
package com.my_example
import groovy.transform.CompileStatic
@CompileStatic
class TestNegate { 
    void xxx() {
          long yyy
           yyy = ~yyy
     }
}
def testNegate = new TestNegate()
{code}
Cause the following error in the compiler:

 groovy.lang.GroovyRuntimeException: ASM reporting processing error for 
com.my_example.TestNegate#xxx with signature void xxx() in 
Script_ca3a8a63b69e01cd97876825de2f258e.groovy:8. 
Script_ca3a8a63b69e01cd97876825de2f258e.groovy

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)

at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Caused by: java.lang.NegativeArraySizeException: -1

at groovyjarjarasm.asm.Frame.merge(Frame.java:1222)

at groovyjarjarasm.asm.MethodWriter.computeAllFrames(MethodWriter.java:1610)

at groovyjarjarasm.asm.MethodWriter.visitMaxs(MethodWriter.java:1546)

... 3 more

  was:
The following code:

-----------------------------------------------------------

 
{code:java}
package com.my_example
import groovy.transform.CompileStatic
@CompileStatic
class TestNegate { 
    void xxx() {
          long yyy
           yyy = ~yyy
     }
}
{code}
 

def testNegate = new TestNegate()

--------------------------------------------------------------

Cause the following error in the compiler:

 groovy.lang.GroovyRuntimeException: ASM reporting processing error for 
com.my_example.TestNegate#xxx with signature void xxx() in 
Script_ca3a8a63b69e01cd97876825de2f258e.groovy:8. 
Script_ca3a8a63b69e01cd97876825de2f258e.groovy

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)

at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Caused by: java.lang.NegativeArraySizeException: -1

at groovyjarjarasm.asm.Frame.merge(Frame.java:1222)

at groovyjarjarasm.asm.MethodWriter.computeAllFrames(MethodWriter.java:1610)

at groovyjarjarasm.asm.MethodWriter.visitMaxs(MethodWriter.java:1546)

... 3 more


> The '~' negate operator causes an ASM processing error when static compiled
> ---------------------------------------------------------------------------
>
>                 Key: GROOVY-9704
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9704
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 3.0.5
>         Environment: Window 10, Groovy 3.05, Java 13.0.2 2020-01-14. Ran from 
> GroovyConsole, but problem occurs when building from Gradle as well.
>            Reporter: Eric Holley
>            Priority: Major
>
> The following code:
> {code:java}
> package com.my_example
> import groovy.transform.CompileStatic
> @CompileStatic
> class TestNegate { 
>     void xxx() {
>           long yyy
>            yyy = ~yyy
>      }
> }
> def testNegate = new TestNegate()
> {code}
> Cause the following error in the compiler:
>  groovy.lang.GroovyRuntimeException: ASM reporting processing error for 
> com.my_example.TestNegate#xxx with signature void xxx() in 
> Script_ca3a8a63b69e01cd97876825de2f258e.groovy:8. 
> Script_ca3a8a63b69e01cd97876825de2f258e.groovy
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.NegativeArraySizeException: -1
> at groovyjarjarasm.asm.Frame.merge(Frame.java:1222)
> at groovyjarjarasm.asm.MethodWriter.computeAllFrames(MethodWriter.java:1610)
> at groovyjarjarasm.asm.MethodWriter.visitMaxs(MethodWriter.java:1546)
> ... 3 more



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

Reply via email to