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,10 +3745,13 @@ addrescapes(Node *n)
case ODOT:
case OINDEX:
// ODOTPTR has already been
// introduced, so these are the non-pointer
// ODOT and OINDEX.
addrescapes(n->left);
// ODOTPTR has already been introduced,
// so these are the non-pointer 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);
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