diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-14 13:42:05 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-14 13:42:05 -0200 |
commit | a845a46cc883a76cb5175c0755805ba44a37d909 (patch) | |
tree | 848907537a468ce2fcec3eccc4b250ba51e46123 | |
parent | 097edd388494bf8d294adb101b9c5fda688813e1 (diff) | |
download | lua-a845a46cc883a76cb5175c0755805ba44a37d909.tar.gz lua-a845a46cc883a76cb5175c0755805ba44a37d909.tar.bz2 lua-a845a46cc883a76cb5175c0755805ba44a37d909.zip |
C function may leave garbage on the stack (besides return values)
-rw-r--r-- | lua.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.106 2002/10/21 20:43:38 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.107 2002/11/11 13:28:06 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -362,8 +362,10 @@ static int handle_argv (char *argv[], int *interactive) { | |||
362 | 362 | ||
363 | static void openstdlibs (lua_State *l) { | 363 | static void openstdlibs (lua_State *l) { |
364 | const luaL_reg *lib = lualibs; | 364 | const luaL_reg *lib = lualibs; |
365 | for (; lib->name; lib++) | 365 | for (; lib->name; lib++) { |
366 | lua_pop(l, lib->func(l)); /* open library, discard any results */ | 366 | lib->func(l); /* open library */ |
367 | lua_settop(l, 0); /* discard any results */ | ||
368 | } | ||
367 | } | 369 | } |
368 | 370 | ||
369 | 371 | ||