aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-06-19 17:23:29 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-06-19 17:23:29 -0300
commitdc59444cd120e38d0babaeb3a7ad3d36f63225e6 (patch)
tree4f6007975cd3d11855ab135b52c1bb285118c36a
parent6c042e17b15f1381296a7ec1cd207741ade71170 (diff)
downloadlua-dc59444cd120e38d0babaeb3a7ad3d36f63225e6.tar.gz
lua-dc59444cd120e38d0babaeb3a7ad3d36f63225e6.tar.bz2
lua-dc59444cd120e38d0babaeb3a7ad3d36f63225e6.zip
strong collision for very small numbers used as table keys
-rw-r--r--bugs17
1 files changed, 17 insertions, 0 deletions
diff --git a/bugs b/bugs
index adf118d4..f1af3721 100644
--- a/bugs
+++ b/bugs
@@ -1476,6 +1476,23 @@ ldebug.c:
1476} 1476}
1477 1477
1478Bug{ 1478Bug{
1479what = [[Very small numbers all collide in the hash function.
1480(This creates only performance problems; the behavoir is correct.)]],
1481report = [[, on ]],
1482since = [[Lua 5.0]],
1483example = [[ ]],
1484patch = [[
1485ltable.c:
148687,88c87,88
1487< n += 1; /* normalize number (avoid -0) */
1488< lua_assert(sizeof(a) <= sizeof(n));
1489---
1490> if (luai_numeq(n, 0)) /* avoid problems with -0 */
1491> return gnode(t, 0);
1492]],
1493}
1494
1495Bug{
1479what = [[ ]], 1496what = [[ ]],
1480report = [[ , on ]], 1497report = [[ , on ]],
1481since = [[i ]], 1498since = [[i ]],