Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lua_cmsgpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
mp_cur_consume(c,9);
}
break;
case 0xc4: /* bin 8 */
case 0xd9: /* raw 8 */
mp_cur_need(c,2);
{
Expand All @@ -697,6 +698,7 @@ void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
mp_cur_consume(c,2+l);
}
break;
case 0xc5: /* bin 16 */
case 0xda: /* raw 16 */
mp_cur_need(c,3);
{
Expand All @@ -706,6 +708,7 @@ void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
mp_cur_consume(c,3+l);
}
break;
case 0xc6: /* bin 32 */
case 0xdb: /* raw 32 */
mp_cur_need(c,5);
{
Expand Down
3 changes: 3 additions & 0 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ test_pack_and_unpack("int64",-1099511627776,"d3ffffff0000000000")
test_pack_and_unpack("raw8"," ","d921202020202020202020202020202020202020202020202020202020202020202020")
test_pack_and_unpack("raw16"," ","da01012020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020")
test_pack_and_unpack("array 16",{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},"dc001000000000000000000000000000000000")
test_unpack("bin8","c421202020202020202020202020202020202020202020202020202020202020202020"," ")
test_unpack("bin16","c501012020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020"," ")
test_unpack("bin32","c600000021202020202020202020202020202020202020202020202020202020202020202020"," ")

-- Regression test for issue #4, cyclic references in tables.
a = {x=nil,y=5}
Expand Down