From 505fc9122255b8a2ef761720bca21fd5e9be8e73 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 1 Jun 2018 14:40:38 -0300 Subject: no more 'luaO_nilobject' to avoid comparison of global variable addresses (now uses static variables) --- lstate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 5a2c3577..2622a1d9 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.151 2018/02/05 17:11:37 roberto Exp roberto $ +** $Id: lstate.c,v 2.152 2018/05/29 18:02:51 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -69,12 +69,11 @@ typedef struct LG { memcpy(b + p, &t, sizeof(t)); p += sizeof(t); } static unsigned int luai_makeseed (lua_State *L) { - char buff[4 * sizeof(size_t)]; + char buff[3 * sizeof(size_t)]; unsigned int h = cast_uint(time(NULL)); int p = 0; addbuff(buff, p, L); /* heap variable */ addbuff(buff, p, &h); /* local variable */ - addbuff(buff, p, luaO_nilobject); /* global variable */ addbuff(buff, p, &lua_newstate); /* public function */ lua_assert(p == sizeof(buff)); return luaS_hash(buff, p, h); -- cgit v1.2.3-55-g6feb