Skip to content
Snippets Groups Projects
Commit 9a0ded7d authored by Dmitry Simonenko's avatar Dmitry Simonenko
Browse files

core-lua-i64: fixed lua_pushcdata for proper box.unpack multiret, test

case
parent 600d3479
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "lj_ctype.h" #include "lj_ctype.h"
#include "lj_cdata.h" #include "lj_cdata.h"
#include "lj_cconv.h" #include "lj_cconv.h"
#include "lj_state.h"
#include "pickle.h" #include "pickle.h"
#include "fiber.h" #include "fiber.h"
...@@ -252,10 +253,10 @@ luaL_pushcdata(struct lua_State *L, CTypeID id, int bits) ...@@ -252,10 +253,10 @@ luaL_pushcdata(struct lua_State *L, CTypeID id, int bits)
CTSize sz; CTSize sz;
lj_ctype_info(cts, id, &sz); lj_ctype_info(cts, id, &sz);
GCcdata *cd = lj_cdata_new(cts, id, bits); GCcdata *cd = lj_cdata_new(cts, id, bits);
TValue *o = L->base + 1; TValue *o = L->top;
setcdataV(L, o - 1, cd); setcdataV(L, o, cd);
lj_cconv_ct_init(cts, ct, sz, cdataptr(cd), o, 0); lj_cconv_ct_init(cts, ct, sz, cdataptr(cd), o, 0);
L->top = o; incr_top(L);
return cd; return cd;
} }
......
...@@ -95,3 +95,18 @@ lua num == tonumber64('18446744073709551615') ...@@ -95,3 +95,18 @@ lua num == tonumber64('18446744073709551615')
--- ---
- true - true
... ...
lua num,num1,num2 = box.unpack('lll', tu[0], tu[0], tu[0])
---
...
lua num == tonumber64('18446744073709551615')
---
- true
...
lua num1 == tonumber64('18446744073709551615')
---
- true
...
lua num2 == tonumber64('18446744073709551615')
---
- true
...
...@@ -47,3 +47,7 @@ exec admin "lua num = box.unpack('l', tu[0])" ...@@ -47,3 +47,7 @@ exec admin "lua num = box.unpack('l', tu[0])"
exec admin "lua print(num)" exec admin "lua print(num)"
exec admin "lua type(num) == 'cdata'" exec admin "lua type(num) == 'cdata'"
exec admin "lua num == tonumber64('18446744073709551615')" exec admin "lua num == tonumber64('18446744073709551615')"
exec admin "lua num,num1,num2 = box.unpack('lll', tu[0], tu[0], tu[0])"
exec admin "lua num == tonumber64('18446744073709551615')"
exec admin "lua num1 == tonumber64('18446744073709551615')"
exec admin "lua num2 == tonumber64('18446744073709551615')"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment