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

BUG! exception in phase 'class generation' while poping argument from operand stack tracker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0-rc-1
    • 2.1.4
    • Static compilation
    • None

    Description

      The following fails with the above exception:

      @groovy.transform.CompileStatic
      class Test {
        long[] data
        long topMask
          
        void doSomething() {
          data[ 0 ] |= 0x7ffffffl
        }
      }
      
      new Test()
      

      changing doSomething to:

      void doSomething() {
        data[ 0 ] = data[ 0 ] | 0x7ffffffl
      }
      

      is a workaround

      exception:

      BUG! exception in phase 'class generation' in source unit 'ConsoleScript64' Error while poping argument from operand stack tracker in class Test method void doSomething().
      	at org.codehaus.groovy.classgen.asm.OperandStack.popWithMessage(OperandStack.java:79)
      	at org.codehaus.groovy.classgen.asm.OperandStack.popDownTo(OperandStack.java:60)
      	at org.codehaus.groovy.classgen.asm.OperandStack.pop(OperandStack.java:167)
      	at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateArrayAssignmentWithOperator(BinaryExpressionHelper.java:531)
      	at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateBinaryExpressionWithAssignment(BinaryExpressionHelper.java:547)
      	at org.codehaus.groovy.classgen.asm.BinaryExpressionMultiTypeDispatcher.evaluateBinaryExpressionWithAssignment(BinaryExpressionMultiTypeDispatcher.java:347)
      	at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper.java:130)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:529)
      	at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:604)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:511)
      	at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:81)
      	at org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:49)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:457)
      	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:321)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:278)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:398)
      	at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1059)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:180)
      	at org.codehaus.groovy.control.CompilationUnit$15.call(CompilationUnit.java:795)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1036)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:573)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:551)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:528)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
      

      Attachments

        Activity

          People

            melix Cédric Champeau
            tim_yates Tim Yates
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: