aboutsummaryrefslogtreecommitdiff
path: root/src/lua.c
diff options
context:
space:
mode:
authorame <[email protected]>2024-08-10 23:48:17 -0500
committerame <[email protected]>2024-08-10 23:48:17 -0500
commit463325d637250e13dbc3153ce59048cf9be57bdb (patch)
treea621de3a39c972e15e6fa908eba1305c989bdb67 /src/lua.c
parentd944a170f50dac767109ce629a284b9614f48fd6 (diff)
malloc mutex_t
Diffstat (limited to 'src/lua.c')
-rw-r--r--src/lua.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lua.c b/src/lua.c
index 5e083cc..238e1b8 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -53,8 +53,9 @@ void luaI_deepcopy(lua_State* src, lua_State* dest, enum deep_copy_flags flags){
double n;
int old_top = lua_gettop(src);
int modi = 0;
-
- switch(lua_type(src, -1)){
+
+ int type;
+ switch(type = lua_type(src, -1)){
case LUA_TNUMBER:
n = lua_tonumber(src, -1);
if(n == (int)n) lua_pushinteger(dest, (int)n);
@@ -123,7 +124,7 @@ void luaI_deepcopy(lua_State* src, lua_State* dest, enum deep_copy_flags flags){
str* awa = str_init("");
lua_dump(src, writer, (void*)awa, 0);
- luaL_loadbuffer(dest, awa->c, awa->len, awa->c);
+ luaL_loadbuffer(dest, awa->c, awa->len, "fun");
//lua_remove(dest, -2);
str_free(awa);
break;
@@ -138,7 +139,8 @@ void luaI_deepcopy(lua_State* src, lua_State* dest, enum deep_copy_flags flags){
lua_pushlightuserdata(dest, lua_touserdata(src, -1));
break;
default:
- printf("unknown type %i\n",lua_type(src, -1));
+ printf("unknown type %i vs (old)%i\n",lua_type(src, -1), type);
+ abort();
lua_pushnumber(dest, 5);
break;
}