1
0
mirror of https://github.com/golang/go synced 2024-11-21 23:44:39 -07:00

5c, 6c, 8c, 6g, 8g: correct boundary checking

CL 5666043 fixed the same checking for 5g.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5666045
This commit is contained in:
Shenghou Ma 2012-02-15 08:59:03 -05:00 committed by Russ Cox
parent 988968262d
commit 6ed2b6c47d
5 changed files with 5 additions and 5 deletions

View File

@ -357,7 +357,7 @@ regfree(Node *n)
if(n->op != OREGISTER && n->op != OINDREG)
goto err;
i = n->reg;
if(i < 0 || i >= sizeof(reg))
if(i < 0 || i >= nelem(reg))
goto err;
if(reg[i] <= 0)
goto err;

View File

@ -411,7 +411,7 @@ regfree(Node *n)
if(n->op != OREGISTER && n->op != OINDREG)
goto err;
i = n->reg;
if(i < 0 || i >= sizeof(reg))
if(i < 0 || i >= nelem(reg))
goto err;
if(reg[i] <= 0)
goto err;

View File

@ -419,7 +419,7 @@ regfree(Node *n)
i = n->val.u.reg;
if(i == D_SP)
return;
if(i < 0 || i >= sizeof(reg))
if(i < 0 || i >= nelem(reg))
fatal("regfree: reg out of range");
if(reg[i] <= 0)
fatal("regfree: reg not allocated");

View File

@ -372,7 +372,7 @@ regfree(Node *n)
if(n->op != OREGISTER && n->op != OINDREG)
goto err;
i = n->reg;
if(i < 0 || i >= sizeof(reg))
if(i < 0 || i >= nelem(reg))
goto err;
if(reg[i] <= 0)
goto err;

View File

@ -893,7 +893,7 @@ regfree(Node *n)
i = n->val.u.reg;
if(i == D_SP)
return;
if(i < 0 || i >= sizeof(reg))
if(i < 0 || i >= nelem(reg))
fatal("regfree: reg out of range");
if(reg[i] <= 0)
fatal("regfree: reg not allocated");