From f52d1d52a6247aa04dc328d081736b387ad8be6c Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 28 Sep 2015 00:08:39 +0200 Subject: wslua: do not pop from empty stack on newer LUA versions Fixes this failure: tshark: lapi.c:175: lua_settop: Assertion `(-(idx+1) <= (L->top - (func + 1))) && "invalid new top"' failed. Found using LUA 5.2 compiled with -DLUA_USE_APICHECK. Note that the value returned by luaopen_bit does not affect the size of the stack after using lua_call; if there are excess return values, then these will be dropped after calling lua_call. See http://www.lua.org/pil/26.2.html I also verified that the stack is still empty after calling all wslua_reg_module functions. Change-Id: Ia72635277ca4d8077e47a5c472391a78fe6d311e Reviewed-on: https://code.wireshark.org/review/10664 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- epan/wslua/make-reg.pl | 2 -- 1 file changed, 2 deletions(-) (limited to 'epan/wslua/make-reg.pl') diff --git a/epan/wslua/make-reg.pl b/epan/wslua/make-reg.pl index 683ceaf5c1..12975caba2 100755 --- a/epan/wslua/make-reg.pl +++ b/epan/wslua/make-reg.pl @@ -87,8 +87,6 @@ for (@classes) { print C "\twslua_reg_module(L, \"${_}\", ${_}_register);\n"; } print C "\twslua_reg_module(L, \"bit\", luaopen_bit);\n"; -# the bitops library returns a value on the stack - get rid of it -print C "\tlua_pop(L,1);\n"; print C "\twslua_reg_module(L, \"GRegex\", luaopen_rex_glib);\n"; print C "}\n\n"; -- cgit v1.2.3