aboutsummaryrefslogtreecommitdiff
path: root/src/deep.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/deep.cpp')
-rw-r--r--src/deep.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/deep.cpp b/src/deep.cpp
index a3806aa..418724e 100644
--- a/src/deep.cpp
+++ b/src/deep.cpp
@@ -470,11 +470,10 @@ bool copydeep(Universe* U, Dest L2, int L2_cache_i, Source L, int i, LookupMode
470 int const clone_i = lua_gettop( L2); 470 int const clone_i = lua_gettop( L2);
471 while( nuv) 471 while( nuv)
472 { 472 {
473 std::ignore = inter_copy_one(U 473 if (!inter_copy_one(U, L2, L2_cache_i, L, lua_absindex(L, -1), VT::NORMAL, mode_, upName_)) // u uv
474 , L2, L2_cache_i 474 {
475 , L, lua_absindex( L, -1) 475 return luaL_error(L, "Cannot copy upvalue type '%s'", luaL_typename(L, -1));
476 , VT::NORMAL, mode_, upName_ 476 }
477 ); // u uv
478 lua_pop( L, 1); // ... u [uv]* 477 lua_pop( L, 1); // ... u [uv]*
479 // this pops the value from the stack 478 // this pops the value from the stack
480 lua_setiuservalue(L2, clone_i, nuv); // u 479 lua_setiuservalue(L2, clone_i, nuv); // u
@@ -482,14 +481,14 @@ bool copydeep(Universe* U, Dest L2, int L2_cache_i, Source L, int i, LookupMode
482 } 481 }
483 } 482 }
484 483
485 STACK_CHECK( L2, 1); 484 STACK_CHECK(L2, 1);
486 STACK_CHECK( L, 0); 485 STACK_CHECK(L, 0);
487 486
488 if (errmsg != nullptr) 487 if (errmsg != nullptr)
489 { 488 {
490 // raise the error in the proper state (not the keeper) 489 // raise the error in the proper state (not the keeper)
491 lua_State* const errL{ (mode_ == LookupMode::FromKeeper) ? L2 : L }; 490 lua_State* const errL{ (mode_ == LookupMode::FromKeeper) ? L2 : L };
492 std::ignore = luaL_error(errL, errmsg); 491 std::ignore = luaL_error(errL, errmsg); // doesn't return
493 } 492 }
494 return true; 493 return true;
495} \ No newline at end of file 494} \ No newline at end of file