Commit b75a08d0 authored by Russ Cox's avatar Russ Cox

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

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12791044
parent 67a69bce
...@@ -515,8 +515,8 @@ cgen_checknil(Node *n) ...@@ -515,8 +515,8 @@ cgen_checknil(Node *n)
return; return;
while(n->op == ODOT || (n->op == OINDEX && isfixedarray(n->left->type->type))) // NOTE: not ODOTPTR while(n->op == ODOT || (n->op == OINDEX && isfixedarray(n->left->type->type))) // NOTE: not ODOTPTR
n = n->left; n = n->left;
if(thechar == '5' && n->op != OREGISTER) { if((thechar == '5' && n->op != OREGISTER) || !n->addable) {
regalloc(&reg, types[tptr], N); regalloc(&reg, types[tptr], n);
cgen(n, &reg); cgen(n, &reg);
gins(ACHECKNIL, &reg, N); gins(ACHECKNIL, &reg, N);
regfree(&reg); regfree(&reg);
......
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