aboutsummaryrefslogtreecommitdiff
path: root/src/intercopycontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/intercopycontext.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp
index 08709e5..0301382 100644
--- a/src/intercopycontext.cpp
+++ b/src/intercopycontext.cpp
@@ -651,8 +651,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const
651 } 651 }
652 652
653 // no __lanesclone? -> not clonable 653 // no __lanesclone? -> not clonable
654 lua_getfield(L1, -1, "__lanesclone"); // L1: ... mt __lanesclone? 654 if (luaG_getfield(L1, -1, "__lanesclone") == LuaType::NIL) { // L1: ... mt nil
655 if (lua_isnil(L1, -1)) {
656 lua_pop(L1, 2); // L1: ... 655 lua_pop(L1, 2); // L1: ...
657 STACK_CHECK(L1, 0); 656 STACK_CHECK(L1, 0);
658 return false; 657 return false;
@@ -865,7 +864,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const
865 // perform the custom cloning part 864 // perform the custom cloning part
866 lua_insert(L2, -2); // L2: ... u mt 865 lua_insert(L2, -2); // L2: ... u mt
867 // __lanesclone should always exist because we wouldn't be restoring data from a userdata_clone_sentinel closure to begin with 866 // __lanesclone should always exist because we wouldn't be restoring data from a userdata_clone_sentinel closure to begin with
868 lua_getfield(L2, -1, "__lanesclone"); // L2: ... u mt __lanesclone 867 std::ignore = luaG_getfield(L2, -1, "__lanesclone"); // L2: ... u mt __lanesclone
869 lua_remove(L2, -2); // L2: ... u __lanesclone 868 lua_remove(L2, -2); // L2: ... u __lanesclone
870 lua_pushlightuserdata(L2, _clone); // L2: ... u __lanesclone clone 869 lua_pushlightuserdata(L2, _clone); // L2: ... u __lanesclone clone
871 lua_pushlightuserdata(L2, _source); // L2: ... u __lanesclone clone source 870 lua_pushlightuserdata(L2, _source); // L2: ... u __lanesclone clone source
@@ -1083,8 +1082,8 @@ static char const* vt_names[] = {
1083 // Non-POD can be skipped if its metatable contains { __lanesignore = true } 1082 // Non-POD can be skipped if its metatable contains { __lanesignore = true }
1084 if (((1 << static_cast<int>(_val_type)) & kPODmask) == 0) { 1083 if (((1 << static_cast<int>(_val_type)) & kPODmask) == 0) {
1085 if (lua_getmetatable(L1, L1_i)) { // L1: ... mt 1084 if (lua_getmetatable(L1, L1_i)) { // L1: ... mt
1086 lua_getfield(L1, -1, "__lanesignore"); // L1: ... mt ignore? 1085 LuaType const _type{ luaG_getfield(L1, -1, "__lanesignore") }; // L1: ... mt ignore?
1087 if (lua_isboolean(L1, -1) && lua_toboolean(L1, -1)) { 1086 if (_type == LuaType::BOOLEAN && lua_toboolean(L1, -1)) {
1088 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "__lanesignore -> LUA_TNIL\n" INDENT_END(U))); 1087 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "__lanesignore -> LUA_TNIL\n" INDENT_END(U)));
1089 _val_type = LuaType::NIL; 1088 _val_type = LuaType::NIL;
1090 } 1089 }
@@ -1195,8 +1194,7 @@ static char const* vt_names[] = {
1195 continue; 1194 continue;
1196 } 1195 }
1197 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "package.%s\n" INDENT_END(U), _entry)); 1196 DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "package.%s\n" INDENT_END(U), _entry));
1198 lua_getfield(L1, L1_i, _entry); 1197 if (luaG_getfield(L1, L1_i, _entry) == LuaType::NIL) {
1199 if (lua_isnil(L1, -1)) {
1200 lua_pop(L1, 1); 1198 lua_pop(L1, 1);
1201 } else { 1199 } else {
1202 { 1200 {