]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: defer transitive inlining until after AST is edited
authorMatthew Dempsky <mdempsky@google.com>
Tue, 23 Aug 2022 23:34:26 +0000 (16:34 -0700)
committerDavid Chase <drchase@google.com>
Wed, 24 Aug 2022 14:31:08 +0000 (14:31 +0000)
commitf983a9340d5660a9655b63a371966b5df69be8c5
tree6d50dbf600dffd92e091e6827b35a3c5bbd77420
parentb5a9459cd08ec2a74ee4fdabfa4bc1eba0e87e49
cmd/compile: defer transitive inlining until 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 #54632.

Change-Id: I0dd69813c8a70b965174e0072335bc00afedf286
Reviewed-on: https://go-review.googlesource.com/c/go/+/425257
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/inline/inl.go
test/fixedbugs/issue54632.go [new file with mode: 0644]