From 678c1255c92eed9c2c7564d340a5563b17395158 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 1 Feb 2012 19:57:15 -0200 Subject: random seed used in the hash of all strings to avoid intentional collisions --- ltable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index 3683fe60..adccb0a7 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.67 2011/11/30 12:41:45 roberto Exp roberto $ +** $Id: ltable.c,v 2.69 2012/01/25 21:05:40 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -101,7 +101,7 @@ static Node *mainposition (const Table *t, const TValue *key) { case LUA_TLNGSTR: { TString *s = rawtsvalue(key); if (s->tsv.extra == 0) { /* no hash? */ - s->tsv.hash = luaS_hash(getstr(s), s->tsv.len); + s->tsv.hash = luaS_hash(getstr(s), s->tsv.len, s->tsv.hash); s->tsv.extra = 1; /* now it has its hash */ } return hashstr(t, rawtsvalue(key)); -- cgit v1.2.3-55-g6feb