Eric Milles created GROOVY-10424:
------------------------------------

             Summary: SC: stack overflow for optimized boolean on inner class 
with inner class(es)
                 Key: GROOVY-10424
                 URL: https://issues.apache.org/jira/browse/GROOVY-10424
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation
    Affects Versions: 4.0.0-rc-1
            Reporter: Eric Milles
            Assignee: Eric Milles


When using static compilation and checking a private inner class for groovy 
truth, a stack overflow is possible within 
{{BooleanExpressionTransformer#isExtended}}.

{code:groovy}
@groovy.transform.CompileStatic
class Outer {
  private static class Inner {
    private Inner() { // triggers creation of Inner$1 in 
StaticCompilationVisitor$addPrivateBridgeMethods
    }
  }
  void test() {
    def inner = new Inner()
    if (inner) { // optimized boolean expression; StackOverflowError
      print 'works'
    }
  }
}
new Outer().test()
{code}

{code:groovy}
@groovy.transform.CompileStatic
class Outer {
  private static class Inner {
    static class Three {}
  }
  void test() {
    def inner = new Inner()
    if (inner) { // optimized boolean expression; StackOverflowError
      print 'works'
    }
  }
}
new Outer().test()
{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to