mirror of https://github.com/rusefi/lua.git
cannot assign to unlimited variables, because it causes overflow in
the number of returns of a function.
This commit is contained in:
parent
5c19ed2a13
commit
d4dce57f5c
10
bugs
10
bugs
|
@ -88,11 +88,17 @@ Thu Mar 4 11:49:37 EST 1999
|
||||||
** lstrlib.c
|
** lstrlib.c
|
||||||
Fri Apr 30 11:10:20 EST 1999
|
Fri Apr 30 11:10:20 EST 1999
|
||||||
>> '$' at end of pattern was matching regular '$', too.
|
>> '$' at end of pattern was matching regular '$', too.
|
||||||
(by anna)
|
(by anna; since 2.5)
|
||||||
|
|
||||||
** lbuiltin.c
|
** lbuiltin.c
|
||||||
Fri May 21 17:15:11 EST 1999
|
Fri May 21 17:15:11 EST 1999
|
||||||
>> foreach, foreachi, foreachvar points to function in stack when stack
|
>> foreach, foreachi, foreachvar points to function in stack when stack
|
||||||
can be reallocated.
|
can be reallocated.
|
||||||
(by tomas)
|
(by tomas; since 3.2 beta)
|
||||||
|
|
||||||
|
** lparser.c
|
||||||
|
Wed Jun 16 10:32:46 EST 1999
|
||||||
|
>> cannot assign to unlimited variables, because it causes overflow in
|
||||||
|
the number of returns of a function.
|
||||||
|
(since 3.1)
|
||||||
|
|
||||||
|
|
10
lparser.c
10
lparser.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lparser.c,v 1.34 1999/05/21 19:54:06 roberto Exp roberto $
|
** $Id: lparser.c,v 1.35 1999/06/16 13:22:04 roberto Exp roberto $
|
||||||
** LL(1) Parser and code generator for Lua
|
** LL(1) Parser and code generator for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -39,6 +39,11 @@
|
||||||
#define SMAXUPVALUES "32"
|
#define SMAXUPVALUES "32"
|
||||||
|
|
||||||
|
|
||||||
|
/* maximum number of variables in the left side of an assignment */
|
||||||
|
#define MAXVARSLH 100
|
||||||
|
#define SMAXVARSLH "100"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Variable descriptor:
|
** Variable descriptor:
|
||||||
** must include an "exp" option because LL(1) cannot distinguish
|
** must include an "exp" option because LL(1) cannot distinguish
|
||||||
|
@ -1221,6 +1226,9 @@ static void decinit (LexState *ls, listdesc *d) {
|
||||||
|
|
||||||
static int assignment (LexState *ls, vardesc *v, int nvars) {
|
static int assignment (LexState *ls, vardesc *v, int nvars) {
|
||||||
int left = 0;
|
int left = 0;
|
||||||
|
if (nvars > MAXVARSLH)
|
||||||
|
luaX_error(ls, "too many variables in a multiple assignment "
|
||||||
|
MES_LIM(SMAXVARSLH));
|
||||||
unloaddot(ls, v);
|
unloaddot(ls, v);
|
||||||
if (ls->token == ',') { /* assignment -> ',' NAME assignment */
|
if (ls->token == ',') { /* assignment -> ',' NAME assignment */
|
||||||
vardesc nv;
|
vardesc nv;
|
||||||
|
|
Loading…
Reference in New Issue