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:
parent
67a69bce6b
commit
b75a08d03c
@ -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(®, types[tptr], N);
|
||||
if((thechar == '5' && n->op != OREGISTER) || !n->addable) {
|
||||
regalloc(®, types[tptr], n);
|
||||
cgen(n, ®);
|
||||
gins(ACHECKNIL, ®, N);
|
||||
regfree(®);
|
||||
|
Loading…
Reference in New Issue
Block a user