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

Compound assignment to attribute fails with ASM error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.14, 2.5.0
    • 3.0.0-rc-3
    • class generator
    • None

    Description

      The following will fail with 2.4.14 and above.

      class Account {
          int balance = 0
          void credit(int add) {
              this.@balance += add
          }
      }
      
      def acct = new Account()
      acct.credit(3)
      assert acct.balance == 3
      

      Fails with the following in 2.5.0

      groovy.lang.GroovyRuntimeException: ASM reporting processing error for Account#credit with signature void credit(int)
      

      And this starting in 2.4.14

      java.lang.VerifyError: (class: Account, method: credit signature: (I)V) Unable to pop operand off an empty stack
      

      Possibly related to the fixes for GROOVY-8385 and the operand stack not being marked to handle the compound assignment operators.

      Issue reported on the dev mailing list.

      Attachments

        Activity

          People

            emilles Eric Milles
            jwagenleitner John Wagenleitner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: