History

Lua 5.1.1-rc3

Lua Team committed 20 years ago

Commit 90120a81 parent c9e49984 files · +18 −14Browse files

Unified · Split

4 files
  1. doc/manual.html +6 −5
  2. src/ldo.c +4 −3
  3. src/lparser.c +6 −5
  4. src/lvm.c +2 −1
doc/manual.html+6−5
@@ -7905,7 +7905,7 @@ then <code>getinfo</code> returns <b>nil</b>. · 7904 unmodified lines
79057905
79067906
79077907 <p>
7908−The returned table my contain all the fields returned by <a href="#lua_getinfo"><code>lua_getinfo</code></a>,
7908+The returned table may contain all the fields returned by <a href="#lua_getinfo"><code>lua_getinfo</code></a>,
79097909 with the string <code>what</code> describing which fields to fill in.
79107910 The default for <code>what</code> is to get all information available,
79117911 except the table of valid lines.
@@ -8370,9 +8370,7 @@ is not a userdata of the expected type. · 458 unmodified lines
83708370
83718371 <p>
83728372 Here is the complete syntax of Lua in extended BNF.
8373−It does not describe operator priorities or some syntactical restrictions,
8374−such as <b>return</b> and <b>break</b> statements
8375−can only appear as the <em>last</em> statement of a block.
8373+(It does not describe operator precedences.)
83768374
83778375
83788376
@@ -8448,8 +8446,11 @@ can only appear as the <em>last</em> statement of a block. · 69 unmodified lines
84488446 <HR>
84498447 <SMALL>
84508448 Last update:
8451−Fri Jun 2 14:33:44 BRT 2006
8449+Mon Jun 5 17:05:27 BRT 2006
84528450 </SMALL>
8451+<!--
8452+Last change: ready for Lua 5.1.1
8453+-->
84538454
84548455 </body></html>
84558456
src/ldo.c+4−3
@@ -1,5 +1,5 @@
11 /*
2−** $Id: ldo.c,v 2.37 2005/12/22 16:19:56 roberto Exp $
2+** $Id: ldo.c,v 2.38 2006/06/05 19:36:14 roberto Exp $
33 ** Stack and Call structure of Lua
44 ** See Copyright Notice in lua.h
55 */
@@ -383,12 +383,14 @@ void luaD_call (lua_State *L, StkId func, int nResults) { · 377 unmodified lines
383383 static void resume (lua_State *L, void *ud) {
384384 StkId firstArg = cast(StkId, ud);
385385 CallInfo *ci = L->ci;
386− if (L->status != LUA_YIELD) { /* start coroutine */
386+ if (L->status == 0) { /* start coroutine? */
387387 lua_assert(ci == L->base_ci && firstArg > L->base);
388388 if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA)
389389 return;
390390 }
391391 else { /* resuming from previous yield */
392+ lua_assert(L->status == LUA_YIELD);
393+ L->status = 0;
392394 if (!f_isLua(ci)) { /* `common' yield? */
393395 /* finish interrupted execution of `OP_CALL' */
394396 lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL ||
@@ -399,7 +401,6 @@ static void resume (lua_State *L, void *ud) { · 4 unmodified lines
399401 else /* yielded inside a hook: just continue its execution */
400402 L->base = L->ci->base;
401403 }
402− L->status = 0;
403404 luaV_execute(L, cast_int(L->ci - L->base_ci));
404405 }
405406
src/lparser.c+6−5
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lparser.c,v 2.41 2006/03/09 18:15:48 roberto Exp $
2+** $Id: lparser.c,v 2.42 2006/06/05 15:57:59 roberto Exp $
33 ** Lua Parser
44 ** See Copyright Notice in lua.h
55 */
@@ -299,7 +299,8 @@ static void leaveblock (FuncState *fs) { · 293 unmodified lines
299299 removevars(fs->ls, bl->nactvar);
300300 if (bl->upval)
301301 luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
302− lua_assert(!bl->isbreakable || !bl->upval); /* loops have no body */
302+ /* a block either controls scope or breaks (never both) */
303+ lua_assert(!bl->isbreakable || !bl->upval);
303304 lua_assert(bl->nactvar == fs->nactvar);
304305 fs->freereg = fs->nactvar; /* free registers */
305306 luaK_patchtohere(fs, bl->breaklist);
@@ -444,6 +445,7 @@ static void recfield (LexState *ls, struct ConsControl *cc) { · 138 unmodified lines
444445 FuncState *fs = ls->fs;
445446 int reg = ls->fs->freereg;
446447 expdesc key, val;
448+ int rkkey;
447449 if (ls->t.token == TK_NAME) {
448450 luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
449451 checkname(ls, &key);
@@ -452,10 +454,9 @@ static void recfield (LexState *ls, struct ConsControl *cc) { · 2 unmodified lines
452454 yindex(ls, &key);
453455 cc->nh++;
454456 checknext(ls, '=');
455− luaK_exp2RK(fs, &key);
457+ rkkey = luaK_exp2RK(fs, &key);
456458 expr(ls, &val);
457− luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, luaK_exp2RK(fs, &key),
458− luaK_exp2RK(fs, &val));
459+ luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val));
459460 fs->freereg = reg; /* free registers */
460461 }
461462
src/lvm.c+2−1
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lvm.c,v 2.62 2006/01/23 19:51:43 roberto Exp $
2+** $Id: lvm.c,v 2.63 2006/06/05 15:58:59 roberto Exp $
33 ** Lua virtual machine
44 ** See Copyright Notice in lua.h
55 */
@@ -376,6 +376,7 @@ void luaV_execute (lua_State *L, int nexeccalls) { · 370 unmodified lines
376376 TValue *k;
377377 const Instruction *pc;
378378 reentry: /* entry point */
379+ lua_assert(isLua(L->ci));
379380 pc = L->savedpc;
380381 cl = &clvalue(L->ci->func)->l;
381382 base = L->base;