summaryrefslogtreecommitdiff
path: root/tokhash.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-08-31 06:06:17 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-08-31 06:06:17 +0000
commit535af831f15a2a89e726d0c9a38103005b3bce27 (patch)
tree29a3905142a987ccb44ba3d105e4cf584476e0e7 /tokhash.pl
parent9e4dba2f4780237bfcc49859b075c5b42b5dbbfd (diff)
downloadnasm-535af831f15a2a89e726d0c9a38103005b3bce27.tar.gz
nasm-535af831f15a2a89e726d0c9a38103005b3bce27.tar.bz2
nasm-535af831f15a2a89e726d0c9a38103005b3bce27.zip
tokhash.pl: "ix" should have the same width as the "hash" arrays
For correctness in case of a very "linear" graph, "ix" needs to have the same width as the "hash" arrays.
Diffstat (limited to 'tokhash.pl')
-rwxr-xr-xtokhash.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/tokhash.pl b/tokhash.pl
index 58109fd..4730a8b 100755
--- a/tokhash.pl
+++ b/tokhash.pl
@@ -171,7 +171,9 @@ print "\t};\n\n";
print "\tuint32_t k1 = 0, k2 = 0;\n";
print "\tuint8_t c;\n";
-print "\tunsigned int ix;\n";
+# For correct overflow behavior, "ix" should be unsigned of the same
+# width as the hash arrays.
+print "\tuint16_t ix;\n";
print "\tconst struct tokendata *data;\n";
print "\tconst char *p = token;\n";
print "\n";