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

VerifyError when return in catch lbock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • 1.0-beta-6
    • None
    • None
    • Windows XP
      Java 1.4.2_04
      groovy-1.0-beta-5

    Description

      With the following script:

      try {
      println "Dosomething"
      }
      catch (Exception e) {
      println "Message: " + e.message
      return
      }

      I get the following exception from a GroovyShell.evaluate()

      java.lang.VerifyError: (class: test, method: run signature: ()Ljava/lang/Object Unable to pop operand off an empty stack
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
      at java.lang.Class.getConstructor0(Class.java:1922)
      at java.lang.Class.newInstance0(Class.java:278)
      at java.lang.Class.newInstance(Class.java:261)
      at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:379)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:362)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:344)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:327)
      at RunTest.main(RunTest.java:15)
      Exception in thread "main"

      with this script:

      class Test {
      void x() {
      try

      { println "Dosomething" }

      catch (Exception e)

      { println "Message: " + e.message return }


      }
      }

      I get the following stack dump

      java.lang.VerifyError: (class: Test, method: x signature: ()V) Illegal target of jump or branch
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
      at java.lang.Class.getConstructor0(Class.java:1922)
      at java.lang.Class.newInstance0(Class.java:278)
      at java.lang.Class.newInstance(Class.java:261)
      at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:379)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:362)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:344)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:327)
      at RunTest.main(RunTest.java:15)
      Exception in thread "main"

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            rhensley Richard Hensley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: