diff options
| author | ame <[email protected]> | 2024-08-10 23:48:17 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-08-10 23:48:17 -0500 |
| commit | 520a98fd73faddfddcbef75ac0609c7ca745a542 (patch) | |
| tree | a621de3a39c972e15e6fa908eba1305c989bdb67 /src/lua.c | |
| parent | 9c84e52bdbd218dc0600e41acb8375ed1fb8a8c8 (diff) | |
malloc mutex_t
Diffstat (limited to 'src/lua.c')
| -rw-r--r-- | src/lua.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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;
}
|
