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:
parent
988968262d
commit
6ed2b6c47d
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user