]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: print accurate escape reason for non-const-length slices
authorAlberto Donizetti <alb.donizetti@gmail.com>
Wed, 28 Mar 2018 10:19:46 +0000 (12:19 +0200)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Wed, 28 Mar 2018 16:56:03 +0000 (16:56 +0000)
commit360c19157ae5465c9548bd9e050263b9e336c9bf
tree702b28abc608f07a5871814f65952aa3712e77ae
parentf8b28e28f8e41d988ff1c08721e6f7d33f3fa7ff
cmd/compile: print accurate escape reason for non-const-length slices

This change makes `-m -m` print a better explanation for the case
where a slice is marked as escaping and heap-allocated because it
has a non-constant len/cap.

Fixes #24578

Change-Id: I0ebafb77c758a99857d72b365817bdba7b446cc0
Reviewed-on: https://go-review.googlesource.com/102895
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
src/cmd/compile/internal/gc/esc.go
test/escape_array.go
test/escape_because.go