]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: in escape analysis, use element type for OIND of slice
authorCherry Zhang <cherryyz@google.com>
Tue, 17 Apr 2018 20:28:13 +0000 (16:28 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 18 Apr 2018 02:59:37 +0000 (02:59 +0000)
commit3042463d61a4a9165531aaf45833f1dcefb1e5f9
treeb9ed2e7058819dfab7412cac705ee2425e94da47
parent94197135287ae2e1b886c4de9eaf4e1d8b1488ba
cmd/compile: in escape analysis, use element type for OIND of slice

The escape analysis models the flow of "content" of X with a
level of "indirection" (OIND node) of X. This content can be
pointer dereference, or slice/string element. For the latter
case, the type of the OIND node should be the element type of
the slice/string. This CL fixes this. In particular, this
matters when the element type is pointerless, where the data
flow should not cause any escape.

Fixes #15730.

Change-Id: Iba9f92898681625e7e3ddef76ae65d7cd61c41e0
Reviewed-on: https://go-review.googlesource.com/107597
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/esc.go
test/escape5.go