Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9704

The '~' negate operator causes an ASM processing error when static compiled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.20, 3.0.5, 2.5.13
    • 4.0.0-alpha-1, 2.4.21, 2.5.14, 3.0.6
    • Compiler
    • None
    • Window 10, Groovy 3.05, Java 13.0.2 2020-01-14. Ran from GroovyConsole, but problem occurs when building from Gradle as well.

    Description

      The following code:

      package com.my_example
      import groovy.transform.CompileStatic
      @CompileStatic
      class TestNegate { 
          void xxx() {
                long yyy
                 yyy = ~yyy
           }
      }
      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
      

       

      Attachments

        Activity

          People

            emilles Eric Milles
            holley256 Eric Holley
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m