1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:10:04 -07:00

cmd/gc: ensure addable in checknil (fix race build)

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12791044
This commit is contained in:
Russ Cox 2013-08-15 21:05:05 -04:00
parent 67a69bce6b
commit b75a08d03c

View File

@ -515,8 +515,8 @@ cgen_checknil(Node *n)
return;
while(n->op == ODOT || (n->op == OINDEX && isfixedarray(n->left->type->type))) // NOTE: not ODOTPTR
n = n->left;
if(thechar == '5' && n->op != OREGISTER) {
regalloc(&reg, types[tptr], N);
if((thechar == '5' && n->op != OREGISTER) || !n->addable) {
regalloc(&reg, types[tptr], n);
cgen(n, &reg);
gins(ACHECKNIL, &reg, N);
regfree(&reg);