]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: be stricter about recognizing safety rule #4
authorMatthew Dempsky <mdempsky@google.com>
Wed, 22 Apr 2020 21:37:02 +0000 (14:37 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 23 Apr 2020 00:08:35 +0000 (00:08 +0000)
commitf049d911e93b84577577e73108605627ed522409
tree03d37cc8d9f5b5ecf61ff99b254445822e1d92f3
parented7888aea6021e25b0ea58bcad3f26da2b139432
cmd/compile: be stricter about recognizing safety rule #4

unsafe.Pointer safety rule #4 says "The compiler handles a Pointer
converted to a uintptr in the argument list of a call". Within escape
analysis, we've always required this be a single conversion
unsafe.Pointer->uintptr conversion, but the corresponding logic in
order is somewhat laxer, allowing arbitrary chains of OCONVNOPs from
unsafe.Pointer to uintptr.

This CL changes order to be stricter to match escape analysis.

Passes toolstash-check.

Change-Id: Iadd210d2123accb2020f5728ea2a47814f703352
Reviewed-on: https://go-review.googlesource.com/c/go/+/229578
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go1.15.html
src/cmd/compile/internal/gc/order.go