-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: inlining function that references function literals generates bad code [1.19 backport] #59158
Comments
Since this is a serious bug, and the fix already shipped in 1.20 (http://go.dev/cl/425257), a backport to 1.19 seems appropriate and safe. |
Change https://go.dev/cl/479629 mentions this issue: |
Closed by merging 837b131 to release-branch.go1.19. |
…after AST is edited This CL changes the inliner to process transitive inlining iteratively after the AST has actually been edited, rather than recursively and immediately. This is important for handling indirect function calls correctly, because ir.reassigned walks the function body looking for reassignments; whereas previously the inlined reassignments might not have been actually added to the AST yet. Fixes #59158. Change-Id: I0dd69813c8a70b965174e0072335bc00afedf286 Reviewed-on: https://go-review.googlesource.com/c/go/+/425257 Run-TryBot: Matthew Dempsky <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Cuong Manh Le <[email protected]> Reviewed-by: David Chase <[email protected]> (cherry picked from commit f983a93) Reviewed-on: https://go-review.googlesource.com/c/go/+/479629 Reviewed-by: Heschi Kreinick <[email protected]>
Change https://go.dev/cl/481797 mentions this issue: |
…after AST is edited This CL changes the inliner to process transitive inlining iteratively after the AST has actually been edited, rather than recursively and immediately. This is important for handling indirect function calls correctly, because ir.reassigned walks the function body looking for reassignments; whereas previously the inlined reassignments might not have been actually added to the AST yet. Fixes #59158. This change was previously reverted as CL 481796 because the branch was frozen for release. Change-Id: I97fcd32956cc1349d87a92066e8559cb90da73b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/481797 Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Michael Knyszek <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
@ianlancetaylor requested issue #54632 to be considered for backport to the next 1.19 minor release.
The text was updated successfully, but these errors were encountered: