1
0
mirror of https://github.com/golang/go synced 2024-11-23 18:50:05 -07:00

cmd/gc: Don't zero more than we need.

Don't merge with the zero range, we may
end up zeroing more than we need.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/83430044
This commit is contained in:
Keith Randall 2014-04-02 09:17:42 -07:00
parent e88e7ed6ba
commit 47acf16709
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ defframe(Prog *ptxt)
if(n->type->width % widthreg != 0 || n->xoffset % widthreg != 0 || n->type->width == 0) if(n->type->width % widthreg != 0 || n->xoffset % widthreg != 0 || n->type->width == 0)
fatal("var %lN has size %d offset %d", n, (int)n->type->width, (int)n->xoffset); fatal("var %lN has size %d offset %d", n, (int)n->type->width, (int)n->xoffset);
if(n->xoffset + n->type->width >= lo - 2*widthptr) { if(lo != hi && n->xoffset + n->type->width >= lo - 2*widthptr) {
// merge with range we already have // merge with range we already have
lo = n->xoffset; lo = n->xoffset;
continue; continue;

View File

@ -42,7 +42,7 @@ defframe(Prog *ptxt)
fatal("needzero class %d", n->class); fatal("needzero class %d", n->class);
if(n->type->width % widthptr != 0 || n->xoffset % widthptr != 0 || n->type->width == 0) if(n->type->width % widthptr != 0 || n->xoffset % widthptr != 0 || n->type->width == 0)
fatal("var %lN has size %d offset %d", n, (int)n->type->width, (int)n->xoffset); fatal("var %lN has size %d offset %d", n, (int)n->type->width, (int)n->xoffset);
if(n->xoffset + n->type->width == lo - 2*widthptr) { if(lo != hi && n->xoffset + n->type->width == lo - 2*widthptr) {
// merge with range we already have // merge with range we already have
lo = n->xoffset; lo = n->xoffset;
continue; continue;