From a274596ecc6edc4a8f2377943ee86fac6ff80acc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 30 Mar 2009 15:38:24 -0300 Subject: avoid making 'lastfree' an invalid pointer --- ltable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index a92b58ca..22419283 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.37 2007/04/18 19:24:35 roberto Exp roberto $ +** $Id: ltable.c,v 2.38 2008/01/30 18:05:23 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -376,7 +376,8 @@ void luaH_free (lua_State *L, Table *t) { static Node *getfreepos (Table *t) { - while (t->lastfree-- > t->node) { + while (t->lastfree > t->node) { + t->lastfree--; if (ttisnil(gkey(t->lastfree))) return t->lastfree; } -- cgit v1.2.3-55-g6feb