diff options
author | bloodstalker <thabogre@gmail.com> | 2018-09-08 22:44:20 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-09-08 22:44:20 +0000 |
commit | 2cd674dac75855c35373d3e6b89359f3e89b1178 (patch) | |
tree | 6fd311b001c475c0a5ccdab4488c31f36be93248 /bruiser/asmrewriter.c | |
parent | some cosmetic changes and makefile fixes (diff) | |
download | mutator-2cd674dac75855c35373d3e6b89359f3e89b1178.tar.gz mutator-2cd674dac75855c35373d3e6b89359f3e89b1178.zip |
jmp_t_s now uses the new way of registering tables, the 5.3 way. bruiser is supposed to be luarocks-friendly so i wont remove the compatibility build.
Diffstat (limited to 'bruiser/asmrewriter.c')
-rw-r--r-- | bruiser/asmrewriter.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bruiser/asmrewriter.c b/bruiser/asmrewriter.c index d8401c4..12d358a 100644 --- a/bruiser/asmrewriter.c +++ b/bruiser/asmrewriter.c @@ -298,6 +298,18 @@ static const luaL_Reg jmpt_meta[] = { }; int jmpt_register(lua_State* __ls) { + lua_newtable(__ls); + luaL_setfuncs(__ls, jmpt_methods, 0); + luaL_newmetatable(__ls, "jmp_s_t"); + luaL_setfuncs(__ls, jmpt_meta, 0); + lua_pushliteral(__ls, "__index"); + lua_pushvalue(__ls, -3); + lua_rawset(__ls, -3); + lua_pushliteral(__ls, "__metatable"); + lua_pushvalue(__ls, -3); + lua_rawset(__ls, -3); + return 1; +#if 0 luaL_openlib(__ls, "jmp_s_t", jmpt_methods, 0); luaL_newmetatable(__ls, "jmp_s_t"); luaL_openlib(__ls, 0, jmpt_meta, 0); @@ -309,6 +321,7 @@ int jmpt_register(lua_State* __ls) { lua_rawset(__ls, -3); lua_pop(__ls, 1); return 1; +#endif } //@DEVI-after jmpt_register, the methods are still on the stack. remove them by lua_pop(__ls, 1) /**********************************************************************************************************************/ |