]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix mishandling of unsafe-uintptr arguments with call method in go/defer
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sun, 21 Feb 2021 15:09:03 +0000 (22:09 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 25 Feb 2021 18:49:25 +0000 (18:49 +0000)
commit1a3e968b1fcb2082b1d99be563a7c9f8c61c66ba
tree2d8ff660d3fca88c050537fedbee38f623ec05b6
parentee2a45e5fbee473b81c8ab81da8d83699d64e01f
cmd/compile: fix mishandling of unsafe-uintptr arguments with call method in go/defer

In CL 253457, we did the same fix for direct function calls. But for
method calls, the receiver argument also need to be passed through the
wrapper function, which we are not doing so the compiler crashes with
the code in #44415.

As we already rewrite t.M(...) into T.M(t, ...) during walkCall1, to fix
this, we can do the same trick in wrapCall, so the receiver argument
will be treated as others.

Fixes #44415

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