mirror of
https://github.com/golang/go
synced 2024-11-26 09:48:14 -07:00
cmd/gc: don't emit type instructions for nonexisting locals
If all locals are optimized away, the type instructions would stay in the instruction stream. Call fixautoused to scrub the output. Fixes #4915. R=rsc CC=golang-dev https://golang.org/cl/7385055
This commit is contained in:
parent
73c21b1312
commit
43c04ba1b8
@ -209,8 +209,10 @@ allocauto(Prog* ptxt)
|
||||
ll = curfn->dcl;
|
||||
n = ll->n;
|
||||
if (n->class == PAUTO && n->op == ONAME && !n->used) {
|
||||
// No locals used at all
|
||||
curfn->dcl = nil;
|
||||
stksize = 0;
|
||||
fixautoused(ptxt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user