diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-22 16:26:30 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-22 16:26:30 +0200 |
| commit | 48985bf413bef59778a4e50ba8391938364bae56 (patch) | |
| tree | 3d99f7171bbddf8d0b5948b30d7719f7b2bc0229 /src/intercopycontext.cpp | |
| parent | b639c229e3fdef21cec4535284eeabbca361dad6 (diff) | |
| download | lanes-48985bf413bef59778a4e50ba8391938364bae56.tar.gz lanes-48985bf413bef59778a4e50ba8391938364bae56.tar.bz2 lanes-48985bf413bef59778a4e50ba8391938364bae56.zip | |
Fix __lanesignore
Diffstat (limited to '')
| -rw-r--r-- | src/intercopycontext.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp index 0301382..6ebbbb0 100644 --- a/src/intercopycontext.cpp +++ b/src/intercopycontext.cpp | |||
| @@ -28,6 +28,7 @@ THE SOFTWARE. | |||
| 28 | 28 | ||
| 29 | #include "debugspew.h" | 29 | #include "debugspew.h" |
| 30 | #include "deep.h" | 30 | #include "deep.h" |
| 31 | #include "keeper.h" | ||
| 31 | #include "universe.h" | 32 | #include "universe.h" |
| 32 | 33 | ||
| 33 | // ################################################################################################# | 34 | // ################################################################################################# |
| @@ -887,7 +888,12 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
| 887 | { | 888 | { |
| 888 | void* const _p{ lua_touserdata(L1, L1_i) }; | 889 | void* const _p{ lua_touserdata(L1, L1_i) }; |
| 889 | DEBUGSPEW_CODE(fprintf(stderr, "%p\n", _p)); | 890 | DEBUGSPEW_CODE(fprintf(stderr, "%p\n", _p)); |
| 890 | lua_pushlightuserdata(L2, _p); | 891 | // when copying a nil sentinel in a non-keeper, write a nil in the destination |
| 892 | if (mode != LookupMode::ToKeeper && kNilSentinel.equals(L1, L1_i)) { | ||
| 893 | lua_pushnil(L2); | ||
| 894 | } else { | ||
| 895 | lua_pushlightuserdata(L2, _p); | ||
| 896 | } | ||
| 891 | return true; | 897 | return true; |
| 892 | } | 898 | } |
| 893 | 899 | ||
| @@ -898,7 +904,12 @@ void InterCopyContext::inter_copy_keyvaluepair() const | |||
| 898 | if (vt == VT::KEY) { | 904 | if (vt == VT::KEY) { |
| 899 | return false; | 905 | return false; |
| 900 | } | 906 | } |
| 901 | lua_pushnil(L2); | 907 | // when copying a nil in a keeper, write a nil sentinel in the destination |
| 908 | if (mode == LookupMode::ToKeeper) { | ||
| 909 | kNilSentinel.pushKey(L2); | ||
| 910 | } else { | ||
| 911 | lua_pushnil(L2); | ||
| 912 | } | ||
| 902 | return true; | 913 | return true; |
| 903 | } | 914 | } |
| 904 | 915 | ||
