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

'if(condition) return' causes VerifyError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-beta-6
    • None
    • None
    • java version "1.4.2_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

    Description

      Running the following script causes
      Exception in thread "main" java.lang.VerifyError: (class: test_return, method: tt signature: ()V) Illegal target of jump or branch

      class test_return {
      static void main(args)

      { tt() }

      static void tt()

      { if (true) return }

      }

      It works without 'if' though.
      Changing 'tt' in the following manner:

      static void tt()

      { if (true) return print("test") }

      Gives different exception:
      Exception in thread "main" java.lang.VerifyError: (class: test_return, method: tt signature: ()V) Falling off the end of the code

      Attachments

        Activity

          People

            spullara Sam Pullara
            kos Konstantin Nikolaev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: