(fix of commit
0cc2c0e7e)
It would be more correct to widen the argument (from unsigned to
GC_word) of multiply operation instead of implicit widening of the
result.
* tests/disclaim_weakmap_test.c (memhash): Cast acc to GC_word before
multiplying by 2003; cast the whole expression to unsigned type (before
assigning it to acc).
my_assert(len % sizeof(GC_word) == 0);
for (i = 0; i < len / sizeof(GC_word); ++i) {
- acc = (2003 * acc + ((GC_word *)src)[i]) / 3;
+ acc = (unsigned)((2003 * (GC_word)acc + ((GC_word *)src)[i]) / 3);
}
return acc;
}