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

Constructor call with @CompileStatic causes ArrayIndexOutOfBoundsException during compilation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.8
    • 2.1.9, 2.2.1
    • Static compilation
    • None

    Description

      Problematic definition:

      https://github.com/grails/grails-core/blob/master/grails-test/src/main/groovy/org/codehaus/groovy/grails/test/runner/GrailsProjectTestRunner.groovy#L101

      Stack trace:

      [ant:groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      [ant:groovyc] General error during clas
      [ant:groovyc] s generation: size==0
      [ant:groovyc] 
      [ant:groovyc] java.lang.ArrayIndexOutOfBoundsException: size==0
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.OperandStack.getTo
      [ant:groovyc] pOperand(OperandStack.java:735)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateEqual(BinaryExpressionHelper
      [ant:groovyc] .java:299)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.sc.StaticTypesBinaryExpressionMultiTypeDispatcher.evaluateEqual(StaticTypesBinar
      [ant:groovyc] yExpressionMultiTypeDispatcher.java:222)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper
      [ant:groovyc] .java:78)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:543)
      [ant:groovyc] 	at org.codehaus.
      [ant:groovyc] groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpre
      [ant:groovyc] ssionStatement(StatementWriter.java:604)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGen
      [ant:groovyc] erator.java:525)
      [ant:groovyc] 	at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
      [ant:groovyc] 	at org.codehaus.groovy
      [ant:groovyc] .classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:81)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.asm.sc.StaticTypesSt
      [ant:groovyc] atementWriter.writeBlockStatement(StaticTypesStatementWriter.java:49)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBl
      [ant:groovyc] ockStatement(AsmClassGenerator.java:471)
      [ant:groovyc] 	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
      [ant:groovyc] 	at org.c
      [ant:groovyc] odehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
      [ant:groovyc] 	at org.codehaus.groovy.ast
      [ant:groovyc] .ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.AsmClassGen
      [ant:groovyc] erator.visitStdMethod(AsmClassGenerator.java:335)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(As
      [ant:groovyc] mClassGenerator.java:292)
      [ant:groovyc] 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructor(ClassCodeVisitorSupport.java:119)
      [ant:groovyc] 
      [ant:groovyc] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructor(AsmClassGenerator.java:407)
      [ant:groovyc] 	at org.codehaus.groovy.ast.Cla
      [ant:groovyc] ssNode.visitContents(ClassNode.java:1051)
      [ant:groovyc] 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport
      [ant:groovyc] .java:50)
      [ant:groovyc] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:180)
      [ant:groovyc] 	at org.codehaus.groovy.cont
      [ant:groovyc] rol.CompilationUnit$15.call(CompilationUnit.java:794)
      [ant:groovyc] 	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(C
      [ant:groovyc] ompilationUnit.java:1036)
      [ant:groovyc] 	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:572)
      [ant:groovyc] 	at org.cod
      [ant:groovyc] ehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:550)
      [ant:groovyc] 	at org.codehaus.groovy.control.Compilatio
      [ant:groovyc] nUnit.compile(CompilationUnit.java:527)
      [ant:groovyc] 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:506)
      [ant:groovyc] 	at or
      [ant:groovyc] g.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:59)
      [ant:groovyc] 	at org.codehaus.groovy.tools.FileSystemCompiler.
      [ant:groovyc] doCompilation(FileSystemCompiler.java:215)
      [ant:groovyc] 	at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompile
      [ant:groovyc] r.java:148)
      [ant:groovyc] 	at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:178)
      [ant:groovyc] 	a
      [ant:groovyc] t org.codehaus.groovy.ant.FileSystemCompilerFacade.main(FileSystemCompilerFacade.java:38)
      [ant:groovyc] 
      [ant:groovyc] 1 error
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: