mirror of
https://github.com/golang/go
synced 2024-11-13 16:50:23 -07:00
bug fix for &x[0] when x is slice
R=ken OCL=25044 CL=25044
This commit is contained in:
parent
18ed7e690a
commit
3b3e63735e
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user