Branch: Tag:

2016-06-29

2016-06-29 13:00:50 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Efuns: Fixed multiple issues with the new hash().

It now follows the same API as the old hash() (ie the second argument
is a modulo). It now also has the same value range as the old hash (eg
it no longer returns negative values), and returns the same value on
both 32-bit and 64-bit platforms.

As a side-effect this fixes a buffer read overrun when the second argument
was larger than the length of the string.

It no longer leaves droppings on the stack.

Updated the testsuite.

278:   <li><a href='ex/predef_3A_3A/has_prefix.html'>has_prefix()</a></li>   <li><a href='ex/predef_3A_3A/has_suffix.html'>has_suffix()</a></li>   <li><a href='ex/predef_3A_3A/has_value.html'>has_value()</a></li> + <li><a href='ex/predef_3A_3A/hash.html'>hash()</a></li>   <li><a href='ex/predef_3A_3A/hash_7_0.html'>hash_7_0()</a></li>   <li><a href='ex/predef_3A_3A/hash_7_4.html'>hash_7_4()</a></li>   <li><a href='ex/predef_3A_3A/hash_7_8.html'>hash_7_8()</a></li>