]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make sure ascompatee walk lhs init statements
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 23 Apr 2021 05:53:51 +0000 (12:53 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 23 Apr 2021 17:36:11 +0000 (17:36 +0000)
commit8c666697646bc820beb3725b3ff4a4cd5514bbe7
treed9e7b655ed82f0e6a8cf17750dd334f0b8a7e9a7
parentd4bfe006155ea0d9c2970e22fca5a027125c8a98
cmd/compile: make sure ascompatee walk lhs init statements

CL 281152 improved ascompatee by removing the call to safeExpr on lhs.
But we forgot that lhs int statements, if any, must be walked prior
saving subexpressions, which cause the bug in #45706.

Fixes #45706

Change-Id: I0064315056ef4ca92ebf3c332c2e3a9bb2b26f68
Reviewed-on: https://go-review.googlesource.com/c/go/+/312632
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/walk/assign.go
test/fixedbugs/issue45706.go [new file with mode: 0644]