Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
9a0ded7d
Commit
9a0ded7d
authored
13 years ago
by
Dmitry Simonenko
Browse files
Options
Downloads
Patches
Plain Diff
core-lua-i64: fixed lua_pushcdata for proper box.unpack multiret, test
case
parent
600d3479
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/tarantool_lua.m
+4
-3
4 additions, 3 deletions
core/tarantool_lua.m
test/box_big/lua.result
+15
-0
15 additions, 0 deletions
test/box_big/lua.result
test/box_big/lua.test
+4
-0
4 additions, 0 deletions
test/box_big/lua.test
with
23 additions
and
3 deletions
core/tarantool_lua.m
+
4
−
3
View file @
9a0ded7d
...
@@ -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;
}
}
...
...
This diff is collapsed.
Click to expand it.
test/box_big/lua.result
+
15
−
0
View file @
9a0ded7d
...
@@ -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
...
This diff is collapsed.
Click to expand it.
test/box_big/lua.test
+
4
−
0
View file @
9a0ded7d
...
@@ -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
'
)
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment