]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix loop depth of range expression in escape analysis
authorCherry Zhang <cherryyz@google.com>
Wed, 29 Nov 2017 20:55:40 +0000 (15:55 -0500)
committerCherry Zhang <cherryyz@google.com>
Thu, 30 Nov 2017 13:45:18 +0000 (13:45 +0000)
commitdbb1d198ab883e9b617ba9cdfb2059fc212f4762
treed5dc9be39e7e2f18eda53658ae2cdadf4a27a5bc
parent8064f82a158e4416e9f32ed7017642ace4280b4f
cmd/compile: fix loop depth of range expression in escape analysis

ORANGE node's Right node is the expression it is ranging over,
which is evaluated before the loop. In the escape analysis,
we should walk this node without loop depth incremented.

Fixes #21709.

Change-Id: Idc1e4c76e39afb5a344d85f6b497930a488ce5cf
Reviewed-on: https://go-review.googlesource.com/80740
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/esc.go
test/fixedbugs/issue21709.go [new file with mode: 0644]