compiler: fix loopdepth tracking in array slicing expression in escape analysis

In the gc compiler, for slicing an array, its AST has an implicit
address operation node. There isn't such node in the gofrontend
AST. During the escape analysis, we create a fake node to mimic
the gc compiler's behavior. For the fake node, the loopdepth was
not tracked correctly, causing miscompilation. Since this is an
address operation, do the same thing as we do for the address
operator.

Fixes golang/go#36404.

Change-Id: I219ef0785f548dc0685e6e1f26c221eff6051334
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/213643
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 file changed