Skip to content

Commit 5f83fb6

Browse files
committed
Details
1 parent 679dc72 commit 5f83fb6

6 files changed

Lines changed: 16 additions & 15 deletions

File tree

lfunc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@
2424

2525

2626

27-
CClosure *luaF_newCclosure (lua_State *L, int n) {
28-
GCObject *o = luaC_newobj(L, LUA_TCCL, sizeCclosure(n));
27+
CClosure *luaF_newCclosure (lua_State *L, int nupvals) {
28+
GCObject *o = luaC_newobj(L, LUA_TCCL, sizeCclosure(nupvals));
2929
CClosure *c = gco2ccl(o);
30-
c->nupvalues = cast_byte(n);
30+
c->nupvalues = cast_byte(nupvals);
3131
return c;
3232
}
3333

3434

35-
LClosure *luaF_newLclosure (lua_State *L, int n) {
36-
GCObject *o = luaC_newobj(L, LUA_TLCL, sizeLclosure(n));
35+
LClosure *luaF_newLclosure (lua_State *L, int nupvals) {
36+
GCObject *o = luaC_newobj(L, LUA_TLCL, sizeLclosure(nupvals));
3737
LClosure *c = gco2lcl(o);
3838
c->p = NULL;
39-
c->nupvalues = cast_byte(n);
40-
while (n--) c->upvals[n] = NULL;
39+
c->nupvalues = cast_byte(nupvals);
40+
while (nupvals--) c->upvals[nupvals] = NULL;
4141
return c;
4242
}
4343

lfunc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454

5555

5656
LUAI_FUNC Proto *luaF_newproto (lua_State *L);
57-
LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems);
58-
LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems);
57+
LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nupvals);
58+
LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nupvals);
5959
LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl);
6060
LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
6161
LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level);

lopcodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
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
2020
iABC C(8) | B(8) |k| A(8) | Op(7) |
2121
iABx Bx(17) | A(8) | Op(7) |
22-
iAsB sBx (signed)(17) | A(8) | Op(7) |
22+
iAsBx sBx (signed)(17) | A(8) | Op(7) |
2323
iAx Ax(25) | Op(7) |
2424
isJ sJ(25) | Op(7) |
2525
@@ -133,7 +133,7 @@ enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */
133133
#define GETARG_sC(i) sC2int(GETARG_C(i))
134134
#define SETARG_C(i,v) setarg(i, v, POS_C, SIZE_C)
135135

136-
#define TESTARG_k(i) (cast_int(((i) & (1u << POS_k))))
136+
#define TESTARG_k(i) check_exp(checkopm(i, iABC), (cast_int(((i) & (1u << POS_k)))))
137137
#define GETARG_k(i) check_exp(checkopm(i, iABC), getarg(i, POS_k, 1))
138138
#define SETARG_k(i,v) setarg(i, v, POS_k, 1)
139139

lparser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ typedef enum {
3535
(string is fixed by the lexer) */
3636
VNONRELOC, /* expression has its value in a fixed register;
3737
info = result register */
38-
VLOCAL, /* local variable; var.ridx = local register;
38+
VLOCAL, /* local variable; var.sidx = stack index (local register);
3939
var.vidx = relative index in 'actvar.arr' */
4040
VUPVAL, /* upvalue variable; info = index of upvalue in 'upvalues' */
4141
VCONST, /* compile-time constant; info = absolute index in 'actvar.arr' */

lvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
10821082
lua_assert(base == ci->func + 1);
10831083
lua_assert(base <= L->top && L->top < L->stack + L->stacksize);
10841084
/* invalidate top for instructions not expecting it */
1085-
lua_assert(isIT(i) || (L->top = base));
1085+
lua_assert(isIT(i) || (cast_void(L->top = base), 1));
10861086
vmdispatch (GET_OPCODE(i)) {
10871087
vmcase(OP_MOVE) {
10881088
setobjs2s(L, ra, RB(i));

manual/manual.of

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8237,7 +8237,8 @@ This library is implemented through table @defid{os}.
82378237
@LibEntry{os.clock ()|
82388238

82398239
Returns an approximation of the amount in seconds of CPU time
8240-
used by the program.
8240+
used by the program,
8241+
as returned by the underlying @ANSI{clock}.
82418242

82428243
}
82438244

@@ -8336,7 +8337,7 @@ closes the Lua state before exiting.
83368337

83378338
@LibEntry{os.getenv (varname)|
83388339

8339-
Returns the value of the process environment variable @id{varname},
8340+
Returns the value of the process environment variable @id{varname}
83408341
or @fail if the variable is not defined.
83418342

83428343
}

0 commit comments

Comments
 (0)