]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix static init for inlined calls
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 17 Nov 2022 12:21:45 +0000 (19:21 +0700)
committerGopher Robot <gobot@golang.org>
Thu, 17 Nov 2022 18:31:28 +0000 (18:31 +0000)
commit249e51e5d9aac5124628d524499ea9c067bc37d5
treef05bb69cd85b5eec9f8bb8828c6b9487ebb35488
parent217ed955887bd59780313bb468862a697b75decd
cmd/compile: fix static init for inlined calls

CL 450136 made the compiler to be able to handle simple inlined calls in
staticinit. However, it's missed a condition when checking substituting
arg for param. If there's any non-trivial closures, it has captured one
of the param, so the substitution could not happen.

Fixes #56778

Change-Id: I427c9134e333e2f9af136c1a124da4d37d326f10
Reviewed-on: https://go-review.googlesource.com/c/go/+/451555
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/staticinit/sched.go
test/fixedbugs/issue56778.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue56778.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue56778.go [new file with mode: 0644]