[
https://issues.apache.org/jira/browse/GROOVY-11286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888753#comment-17888753
]
Eric Milles edited comment on GROOVY-11286 at 10/14/24 3:55 PM:
----------------------------------------------------------------
https://github.com/apache/groovy/commit/1dfc6cd27133c11e0c5e302a9443ac127e17c39b
https://github.com/apache/groovy/commit/7b070d826037130fa22973be696fae23b9bb43db
https://github.com/apache/groovy/commit/338929cefcf6c3d95accdf1494c53eb6be40e63f
was (Author: emilles):
https://github.com/apache/groovy/commit/1dfc6cd27133c11e0c5e302a9443ac127e17c39b
https://github.com/apache/groovy/commit/7b070d826037130fa22973be696fae23b9bb43db
> Extraneous bytecode generated after calls to void methods
> ---------------------------------------------------------
>
> Key: GROOVY-11286
> URL: https://issues.apache.org/jira/browse/GROOVY-11286
> Project: Groovy
> Issue Type: Bug
> Components: class generator, Compiler, Static compilation
> Affects Versions: 2.5.23, 3.0.20, 5.0.0-alpha-4, 4.0.17
> Reporter: Oscar N
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 5.0.0-alpha-11
>
>
> I have the following code:
> {code:groovy}
> package org.example
> import groovy.transform.CompileStatic
> @CompileStatic
> final class Main {
> static void main(String[] args) {
> exampleMethod()
> }
> static void exampleMethod() {}
> }
> {code}
> When looking at the compiled output, null is pushed to the stack then
> immediately popped:
> {code:java}
> // access flags 0x89
> public static varargs main([Ljava/lang/String;)V
> L0
> LINENUMBER 8 L0
> INVOKESTATIC org/example/Main.exampleMethod ()V
> ACONST_NULL
> POP
> L1
> LINENUMBER 9 L1
> RETURN
> LOCALVARIABLE args [Ljava/lang/String; L0 L1 0
> MAXSTACK = 1
> MAXLOCALS = 1
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)