Skip to content

Commit

Permalink
Make struct.unpack wrapped in setlist actually work (#1486)
Browse files Browse the repository at this point in the history
Fixes #1434.
  • Loading branch information
pjsg authored and Johny Mattsson committed Sep 5, 2016
1 parent be263da commit 99cd217
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/lua/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
fixedstack(L);
if (n == 0) {
n = cast_int(L->top - ra) - 1;
L->top = L->ci->top;
}
if (c == 0) c = cast_int(*pc++);
runtime_check(L, ttistable(ra));
Expand All @@ -772,6 +771,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
setobj2t(L, luaH_setnum(L, h, last--), val);
luaC_barriert(L, h, val);
}
L->top = L->ci->top;
unfixedstack(L);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion app/modules/struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static int b_unpack (lua_State *L) {
size_t size = optsize(L, opt, &fmt);
pos += gettoalign(pos, &h, opt, size);
luaL_argcheck(L, pos+size <= ld, 2, "data string too short");
luaL_checkstack(L, 1, "too many results");
luaL_checkstack(L, 2, "too many results");
switch (opt) {
case 'b': case 'B': case 'h': case 'H':
case 'l': case 'L': case 'T': case 'i': case 'I': { /* integer types */
Expand Down

0 comments on commit 99cd217

Please sign in to comment.