GROOVY-9892: fix operand stack for ++x / x++ in static compilation#1455
Merged
daniellansun merged 1 commit intoapache:GROOVY_3_0_Xfrom Jan 15, 2021
Merged
GROOVY-9892: fix operand stack for ++x / x++ in static compilation#1455daniellansun merged 1 commit intoapache:GROOVY_3_0_Xfrom
daniellansun merged 1 commit intoapache:GROOVY_3_0_Xfrom
Conversation
| @@ -0,0 +1,21 @@ | |||
| package org.codehaus.groovy.classgen.asm.sc.bugs | |||
Contributor
There was a problem hiding this comment.
license header is expected here:
Contributor
Author
There was a problem hiding this comment.
License header is now added
| }.call() | ||
| } | ||
| } | ||
| assert new OuterClass().call() == 'Hello1World' |
Contributor
There was a problem hiding this comment.
Could you add a test case to cover counter++ ?
Contributor
Author
There was a problem hiding this comment.
Test modified to verify both prefix and postfix increment
Contributor
|
LGTM |
40ee3fd replaced an invocation of `ScriptBytecodeAdapter.setGroovyObjectProperty()` into an invocation of the generated `pfaccess$0*` mutator method. Contrary to `setGroovyObjectProperty()`, the mutator method has a return value, which ends up pushed to the operand stack. This commit discards the value being pushed to the stack by pop'ing it.
Contributor
|
Merged. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
40ee3fd replaced an invocation of
ScriptBytecodeAdapter.setGroovyObjectProperty()into an invocation ofthe generated
pfaccess$0*mutator method.Contrary to
setGroovyObjectProperty(), the mutator method has a returnvalue, which ends up pushed to the operand stack.
This commit discards the value being pushed to the stack by pop'ing it.