Commit 4c4ca831 authored by Cherry Zhang's avatar Cherry Zhang

cmd/compile: remove nil check in accessing PAUTOHEAP variable

CL 23393 introduces PAUTOHEAP, and access of PAUTOHEAP variable is
rewritten to indirection of a PAUTO variable. Mark this variable
non-nil, so this indirection does not introduce extra nil checks.

Change-Id: I31853eed5e60238b6c5bc0546e2e9ab340dcddd9
Reviewed-on: https://go-review.googlesource.com/26831
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarKeith Randall <khr@golang.org>
parent 40cf4ad0
......@@ -506,7 +506,9 @@ func walkexpr(n *Node, init *Nodes) *Node {
if n.Op == ONAME && n.Class == PAUTOHEAP {
nn := Nod(OIND, n.Name.Heapaddr, nil)
nn = typecheck(nn, Erv)
return walkexpr(nn, init)
nn = walkexpr(nn, init)
nn.Left.NonNil = true
return nn
}
opswitch:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment