mirror of
https://github.com/golang/go
synced 2024-11-25 07:17:56 -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++)
|
||||
h = h+h+h + c;
|
||||
l = (p - symb) + 1;
|
||||
if(h < 0)
|
||||
h = ~h;
|
||||
h &= 0xffffff;
|
||||
h %= NHASH;
|
||||
c = symb[0];
|
||||
for(s = hash[h]; s != S; s = s->link) {
|
||||
|
@ -257,9 +257,7 @@ objlookup(int id, char *name, int type, uint sig)
|
||||
h = *name;
|
||||
for(cp = name+1; *cp; h += *cp++)
|
||||
h *= HASHMUL;
|
||||
if(h < 0)
|
||||
h = ~h;
|
||||
h &= (NHASH-1);
|
||||
h &= NHASH-1;
|
||||
if (type == 'U' || type == 'b' || islocal(type)) {
|
||||
for(sp = hash[h]; sp; sp = sp->next)
|
||||
if(strcmp(sp->s.name, name) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user