From c23f7053495934bc7fbce7328af1e7f03f248de1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 30 Aug 2013 12:49:41 -0300 Subject: BUG: GC can collect a long string still in use during parser --- ltable.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ltable.h') diff --git a/ltable.h b/ltable.h index 2f6f5c2d..b28b6e62 100644 --- a/ltable.h +++ b/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 2.16 2011/08/17 20:26:47 roberto Exp $ +** $Id: ltable.h,v 2.16.1.1 2013/04/12 18:48:47 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -17,6 +17,10 @@ #define invalidateTMcache(t) ((t)->flags = 0) +/* returns the key, given the value of a table entry */ +#define keyfromval(v) \ + (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) + LUAI_FUNC const TValue *luaH_getint (Table *t, int key); LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value); -- cgit v1.2.3-55-g6feb