aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-11-14 13:42:05 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-11-14 13:42:05 -0200
commita845a46cc883a76cb5175c0755805ba44a37d909 (patch)
tree848907537a468ce2fcec3eccc4b250ba51e46123
parent097edd388494bf8d294adb101b9c5fda688813e1 (diff)
downloadlua-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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lua.c b/lua.c
index 37e6353f..93dd06fd 100644
--- a/lua.c
+++ b/lua.c
@@ -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
363static void openstdlibs (lua_State *l) { 363static 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