From b89b4417ecf695dccd9c1bf6a67acc3983715ea0 Mon Sep 17 00:00:00 2001 From: onefang Date: Sat, 19 Nov 2011 01:38:54 +0000 Subject: [PATCH] Keep it clean. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@65397 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_lua2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/edje_lua2.c b/src/lib/edje_lua2.c index a7ab626..e3f13a3 100644 --- a/src/lib/edje_lua2.c +++ b/src/lib/edje_lua2.c @@ -377,7 +377,7 @@ _elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or static int _elua_scan_params(lua_State *L, int i, Eina_Bool tr, char *params, ...) // Stack usage - // if i is a table - // [-0, +n, e] + // [-n, +n, e] // else // [-0, +0, -] // if tr @@ -423,7 +423,6 @@ _elua_scan_params(lua_State *L, int i, Eina_Bool tr, char *params, ...) // Stac *v = lua_tointeger(L, j); // Stack usage [-0, +0, -] n++; } -// FIXME: Should probably pop that name off the stack if it's a table. Same for the following. break; } case '#': @@ -487,6 +486,9 @@ _elua_scan_params(lua_State *L, int i, Eina_Bool tr, char *params, ...) // Stac { if (table) { + // If this is a table, then we pushed a value on the stack, pop it off. But only if not tr, coz otherwise the stack gets reset anyway. + if (!tr) + lua_pop(L, 1); // Stack usage [-n, +0, -] } else j++; -- 2.7.4