summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
de7d9ee)
Found by -fsanitize=undefined.
uint32_t hash = 0;
while(true) {
for(int i = len > 4 ? 4 : len; --i;)
uint32_t hash = 0;
while(true) {
for(int i = len > 4 ? 4 : len; --i;)
- hash += q[len - i] << (8 * i);
+ hash += (uint32_t)q[len - i] << (8 * i);
hash *= 0x9e370001UL; // Golden ratio prime.
if(len <= 4)
break;
hash *= 0x9e370001UL; // Golden ratio prime.
if(len <= 4)
break;