1
0
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:
Daniel Morsing 2013-02-27 19:47:14 +01:00
parent 73c21b1312
commit 43c04ba1b8

View File

@ -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;
}