Commit 3b3e6373 authored by Russ Cox's avatar Russ Cox

bug fix for &x[0] when x is slice

R=ken
OCL=25044
CL=25044
parent 18ed7e69
...@@ -3745,9 +3745,12 @@ addrescapes(Node *n) ...@@ -3745,9 +3745,12 @@ addrescapes(Node *n)
case ODOT: case ODOT:
case OINDEX: case OINDEX:
// ODOTPTR has already been // ODOTPTR has already been introduced,
// introduced, so these are the non-pointer // so these are the non-pointer ODOT and OINDEX.
// ODOT and OINDEX. // In &x[0], if x is a slice, then x does not
// escape--the pointer inside x does, but that
// is always a heap pointer anyway.
if(!isslice(n->left->type))
addrescapes(n->left); addrescapes(n->left);
break; break;
} }
......
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