diff options
Diffstat (limited to 'src/intercopycontext.cpp')
-rw-r--r-- | src/intercopycontext.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp index 07eea24..670b955 100644 --- a/src/intercopycontext.cpp +++ b/src/intercopycontext.cpp | |||
@@ -142,7 +142,7 @@ static constexpr RegistryUniqueKey kMtIdRegKey{ 0xA8895DCF4EC3FE3Cull }; | |||
142 | // get a unique ID for metatable at [i]. | 142 | // get a unique ID for metatable at [i]. |
143 | [[nodiscard]] static lua_Integer get_mt_id(Universe* U_, lua_State* L_, int idx_) | 143 | [[nodiscard]] static lua_Integer get_mt_id(Universe* U_, lua_State* L_, int idx_) |
144 | { | 144 | { |
145 | idx_ = lua_absindex(L_, idx_); | 145 | idx_ = luaG_absindex(L_, idx_); |
146 | 146 | ||
147 | STACK_GROW(L_, 3); | 147 | STACK_GROW(L_, 3); |
148 | 148 | ||
@@ -618,7 +618,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
618 | 618 | ||
619 | [[nodiscard]] bool InterCopyContext::tryCopyClonable() const | 619 | [[nodiscard]] bool InterCopyContext::tryCopyClonable() const |
620 | { | 620 | { |
621 | SourceIndex const _L1_i{ lua_absindex(L1, L1_i) }; | 621 | SourceIndex const _L1_i{ luaG_absindex(L1, L1_i) }; |
622 | void* const _source{ lua_touserdata(L1, _L1_i) }; | 622 | void* const _source{ lua_touserdata(L1, _L1_i) }; |
623 | 623 | ||
624 | STACK_CHECK_START_REL(L1, 0); | 624 | STACK_CHECK_START_REL(L1, 0); |
@@ -650,7 +650,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
650 | 650 | ||
651 | // we need to copy over the uservalues of the userdata as well | 651 | // we need to copy over the uservalues of the userdata as well |
652 | { | 652 | { |
653 | int const mt{ lua_absindex(L1, -2) }; // L1: ... mt __lanesclone | 653 | int const _mt{ luaG_absindex(L1, -2) }; // L1: ... mt __lanesclone |
654 | size_t const userdata_size{ lua_rawlen(L1, _L1_i) }; | 654 | size_t const userdata_size{ lua_rawlen(L1, _L1_i) }; |
655 | // extract all the uservalues, but don't transfer them yet | 655 | // extract all the uservalues, but don't transfer them yet |
656 | int _uvi{ 0 }; | 656 | int _uvi{ 0 }; |
@@ -661,7 +661,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
661 | // create the clone userdata with the required number of uservalue slots | 661 | // create the clone userdata with the required number of uservalue slots |
662 | void* const _clone{ lua_newuserdatauv(L2, userdata_size, _uvi) }; // L2: ... u | 662 | void* const _clone{ lua_newuserdatauv(L2, userdata_size, _uvi) }; // L2: ... u |
663 | // copy the metatable in the target state, and give it to the clone we put there | 663 | // copy the metatable in the target state, and give it to the clone we put there |
664 | InterCopyContext _c{ U, L2, L1, L2_cache_i, SourceIndex{ mt }, VT::NORMAL, mode, name }; | 664 | InterCopyContext _c{ U, L2, L1, L2_cache_i, SourceIndex{ _mt }, VT::NORMAL, mode, name }; |
665 | if (_c.inter_copy_one()) { // L2: ... u mt|sentinel | 665 | if (_c.inter_copy_one()) { // L2: ... u mt|sentinel |
666 | if (LookupMode::ToKeeper == mode) { // L2: ... u sentinel | 666 | if (LookupMode::ToKeeper == mode) { // L2: ... u sentinel |
667 | LUA_ASSERT(L1, lua_tocfunction(L2, -1) == table_lookup_sentinel); | 667 | LUA_ASSERT(L1, lua_tocfunction(L2, -1) == table_lookup_sentinel); |
@@ -688,7 +688,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
688 | } | 688 | } |
689 | // assign uservalues | 689 | // assign uservalues |
690 | while (_uvi > 0) { | 690 | while (_uvi > 0) { |
691 | _c.L1_i = SourceIndex{ lua_absindex(L1, -1) }; | 691 | _c.L1_i = SourceIndex{ luaG_absindex(L1, -1) }; |
692 | if (!_c.inter_copy_one()) { // L2: ... u uv | 692 | if (!_c.inter_copy_one()) { // L2: ... u uv |
693 | raise_luaL_error(getErrL(), "Cannot copy upvalue type '%s'", luaL_typename(L1, -1)); | 693 | raise_luaL_error(getErrL(), "Cannot copy upvalue type '%s'", luaL_typename(L1, -1)); |
694 | } | 694 | } |
@@ -748,7 +748,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
748 | InterCopyContext _c{ U, L2, L1, L2_cache_i, {}, VT::NORMAL, mode, name }; | 748 | InterCopyContext _c{ U, L2, L1, L2_cache_i, {}, VT::NORMAL, mode, name }; |
749 | int const _clone_i{ lua_gettop(L2) }; | 749 | int const _clone_i{ lua_gettop(L2) }; |
750 | while (_nuv) { | 750 | while (_nuv) { |
751 | _c.L1_i = SourceIndex{ lua_absindex(L1, -1) }; | 751 | _c.L1_i = SourceIndex{ luaG_absindex(L1, -1) }; |
752 | if (!_c.inter_copy_one()) { // L1: ... u [uv]* L2: u uv | 752 | if (!_c.inter_copy_one()) { // L1: ... u [uv]* L2: u uv |
753 | raise_luaL_error(getErrL(), "Cannot copy upvalue type '%s'", luaL_typename(L1, -1)); | 753 | raise_luaL_error(getErrL(), "Cannot copy upvalue type '%s'", luaL_typename(L1, -1)); |
754 | } | 754 | } |
@@ -835,7 +835,7 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
835 | // transfer and assign uservalues | 835 | // transfer and assign uservalues |
836 | InterCopyContext c{ *this }; | 836 | InterCopyContext c{ *this }; |
837 | while (_uvi > 0) { | 837 | while (_uvi > 0) { |
838 | c.L1_i = SourceIndex{ lua_absindex(L1, -1) }; | 838 | c.L1_i = SourceIndex{ luaG_absindex(L1, -1) }; |
839 | if (!c.inter_copy_one()) { // L2: ... mt u uv | 839 | if (!c.inter_copy_one()) { // L2: ... mt u uv |
840 | raise_luaL_error(getErrL(), "Cannot copy upvalue type '%s'", luaL_typename(L1, -1)); | 840 | raise_luaL_error(getErrL(), "Cannot copy upvalue type '%s'", luaL_typename(L1, -1)); |
841 | } | 841 | } |