Skip to content

Commit

Permalink
details (using proper version of 'setobj')
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-ieru committed May 23, 2017
1 parent 03094da commit c25380c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ldo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: ldo.c,v 2.158 2017/05/13 12:57:20 roberto Exp roberto $
** $Id: ldo.c,v 2.159 2017/05/13 13:54:47 roberto Exp roberto $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -116,7 +116,7 @@ l_noret luaD_throw (lua_State *L, int errcode) {
global_State *g = G(L);
L->status = cast_byte(errcode); /* mark it as dead */
if (g->mainthread->errorJmp) { /* main thread has a handler? */
setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */
setobj2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */
luaD_throw(g->mainthread, errcode); /* re-throw in main thread */
}
else { /* no handler at all; abort */
Expand Down
6 changes: 3 additions & 3 deletions lvm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.283 2017/05/18 19:34:39 roberto Exp roberto $
** $Id: lvm.c,v 2.284 2017/05/18 19:44:19 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -690,13 +690,13 @@ void luaV_finishOp (lua_State *L) {
StkId top = L->top - 1; /* top when 'luaT_trybinTM' was called */
int b = GETARG_B(inst); /* first element to concatenate */
int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */
setobj2s(L, top - 2, top); /* put TM result in proper position */
setobjs2s(L, top - 2, top); /* put TM result in proper position */
if (total > 1) { /* are there elements to concat? */
L->top = top - 1; /* top is one after last element (at top-2) */
luaV_concat(L, total); /* concat them (may yield again) */
}
/* move final result to final position */
setobj2s(L, ci->func + 1 + GETARG_A(inst), L->top - 1);
setobjs2s(L, ci->func + 1 + GETARG_A(inst), L->top - 1);
L->top = ci->top; /* restore top */
break;
}
Expand Down

0 comments on commit c25380c

Please sign in to comment.