mirror of
https://github.com/golang/go
synced 2024-11-22 03:14:41 -07:00
two more if(h<0) that gcc 4.3 -O2 miscompiles
R=r https://golang.org/cl/160044
This commit is contained in:
parent
b90f673290
commit
e69f12ae1d
@ -226,8 +226,7 @@ lookup(void)
|
|||||||
for(p=symb; c = *p; p++)
|
for(p=symb; c = *p; p++)
|
||||||
h = h+h+h + c;
|
h = h+h+h + c;
|
||||||
l = (p - symb) + 1;
|
l = (p - symb) + 1;
|
||||||
if(h < 0)
|
h &= 0xffffff;
|
||||||
h = ~h;
|
|
||||||
h %= NHASH;
|
h %= NHASH;
|
||||||
c = symb[0];
|
c = symb[0];
|
||||||
for(s = hash[h]; s != S; s = s->link) {
|
for(s = hash[h]; s != S; s = s->link) {
|
||||||
|
@ -257,9 +257,7 @@ objlookup(int id, char *name, int type, uint sig)
|
|||||||
h = *name;
|
h = *name;
|
||||||
for(cp = name+1; *cp; h += *cp++)
|
for(cp = name+1; *cp; h += *cp++)
|
||||||
h *= HASHMUL;
|
h *= HASHMUL;
|
||||||
if(h < 0)
|
h &= NHASH-1;
|
||||||
h = ~h;
|
|
||||||
h &= (NHASH-1);
|
|
||||||
if (type == 'U' || type == 'b' || islocal(type)) {
|
if (type == 'U' || type == 'b' || islocal(type)) {
|
||||||
for(sp = hash[h]; sp; sp = sp->next)
|
for(sp = hash[h]; sp; sp = sp->next)
|
||||||
if(strcmp(sp->s.name, name) == 0) {
|
if(strcmp(sp->s.name, name) == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user