Navigation Menu

Skip to content

Commit

Permalink
Details
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-ieru committed Nov 18, 2019
1 parent 679dc72 commit 5f83fb6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions lfunc.c
Expand Up @@ -24,20 +24,20 @@



CClosure *luaF_newCclosure (lua_State *L, int n) {
GCObject *o = luaC_newobj(L, LUA_TCCL, sizeCclosure(n));
CClosure *luaF_newCclosure (lua_State *L, int nupvals) {
GCObject *o = luaC_newobj(L, LUA_TCCL, sizeCclosure(nupvals));
CClosure *c = gco2ccl(o);
c->nupvalues = cast_byte(n);
c->nupvalues = cast_byte(nupvals);
return c;
}


LClosure *luaF_newLclosure (lua_State *L, int n) {
GCObject *o = luaC_newobj(L, LUA_TLCL, sizeLclosure(n));
LClosure *luaF_newLclosure (lua_State *L, int nupvals) {
GCObject *o = luaC_newobj(L, LUA_TLCL, sizeLclosure(nupvals));
LClosure *c = gco2lcl(o);
c->p = NULL;
c->nupvalues = cast_byte(n);
while (n--) c->upvals[n] = NULL;
c->nupvalues = cast_byte(nupvals);
while (nupvals--) c->upvals[nupvals] = NULL;
return c;
}

Expand Down
4 changes: 2 additions & 2 deletions lfunc.h
Expand Up @@ -54,8 +54,8 @@


LUAI_FUNC Proto *luaF_newproto (lua_State *L);
LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems);
LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems);
LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nupvals);
LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nupvals);
LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl);
LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level);
Expand Down
4 changes: 2 additions & 2 deletions lopcodes.h
Expand Up @@ -19,7 +19,7 @@
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
iABC C(8) | B(8) |k| A(8) | Op(7) |
iABx Bx(17) | A(8) | Op(7) |
iAsB sBx (signed)(17) | A(8) | Op(7) |
iAsBx sBx (signed)(17) | A(8) | Op(7) |
iAx Ax(25) | Op(7) |
isJ sJ(25) | Op(7) |
Expand Down Expand Up @@ -133,7 +133,7 @@ enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */
#define GETARG_sC(i) sC2int(GETARG_C(i))
#define SETARG_C(i,v) setarg(i, v, POS_C, SIZE_C)

#define TESTARG_k(i) (cast_int(((i) & (1u << POS_k))))
#define TESTARG_k(i) check_exp(checkopm(i, iABC), (cast_int(((i) & (1u << POS_k)))))
#define GETARG_k(i) check_exp(checkopm(i, iABC), getarg(i, POS_k, 1))
#define SETARG_k(i,v) setarg(i, v, POS_k, 1)

Expand Down
2 changes: 1 addition & 1 deletion lparser.h
Expand Up @@ -35,7 +35,7 @@ typedef enum {
(string is fixed by the lexer) */
VNONRELOC, /* expression has its value in a fixed register;
info = result register */
VLOCAL, /* local variable; var.ridx = local register;
VLOCAL, /* local variable; var.sidx = stack index (local register);
var.vidx = relative index in 'actvar.arr' */
VUPVAL, /* upvalue variable; info = index of upvalue in 'upvalues' */
VCONST, /* compile-time constant; info = absolute index in 'actvar.arr' */
Expand Down
2 changes: 1 addition & 1 deletion lvm.c
Expand Up @@ -1082,7 +1082,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
lua_assert(base == ci->func + 1);
lua_assert(base <= L->top && L->top < L->stack + L->stacksize);
/* invalidate top for instructions not expecting it */
lua_assert(isIT(i) || (L->top = base));
lua_assert(isIT(i) || (cast_void(L->top = base), 1));
vmdispatch (GET_OPCODE(i)) {
vmcase(OP_MOVE) {
setobjs2s(L, ra, RB(i));
Expand Down
5 changes: 3 additions & 2 deletions manual/manual.of
Expand Up @@ -8237,7 +8237,8 @@ This library is implemented through table @defid{os}.
@LibEntry{os.clock ()|

Returns an approximation of the amount in seconds of CPU time
used by the program.
used by the program,
as returned by the underlying @ANSI{clock}.

}

Expand Down Expand Up @@ -8336,7 +8337,7 @@ closes the Lua state before exiting.

@LibEntry{os.getenv (varname)|

Returns the value of the process environment variable @id{varname},
Returns the value of the process environment variable @id{varname}
or @fail if the variable is not defined.

}
Expand Down

0 comments on commit 5f83fb6

Please sign in to comment.