diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.151 2018/02/05 17:11:37 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.152 2018/05/29 18:02:51 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -69,12 +69,11 @@ typedef struct LG { | |||
69 | memcpy(b + p, &t, sizeof(t)); p += sizeof(t); } | 69 | memcpy(b + p, &t, sizeof(t)); p += sizeof(t); } |
70 | 70 | ||
71 | static unsigned int luai_makeseed (lua_State *L) { | 71 | static unsigned int luai_makeseed (lua_State *L) { |
72 | char buff[4 * sizeof(size_t)]; | 72 | char buff[3 * sizeof(size_t)]; |
73 | unsigned int h = cast_uint(time(NULL)); | 73 | unsigned int h = cast_uint(time(NULL)); |
74 | int p = 0; | 74 | int p = 0; |
75 | addbuff(buff, p, L); /* heap variable */ | 75 | addbuff(buff, p, L); /* heap variable */ |
76 | addbuff(buff, p, &h); /* local variable */ | 76 | addbuff(buff, p, &h); /* local variable */ |
77 | addbuff(buff, p, luaO_nilobject); /* global variable */ | ||
78 | addbuff(buff, p, &lua_newstate); /* public function */ | 77 | addbuff(buff, p, &lua_newstate); /* public function */ |
79 | lua_assert(p == sizeof(buff)); | 78 | lua_assert(p == sizeof(buff)); |
80 | return luaS_hash(buff, p, h); | 79 | return luaS_hash(buff, p, h); |