mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
error message ("too complex" -> "too many registers") + MAXREGS
changed to 255 (no reason not to use maximum allowed)
This commit is contained in:
parent
513c639bf9
commit
a1935b9cba
9
lcode.c
9
lcode.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lcode.c,v 2.99 2014/12/29 16:49:25 roberto Exp roberto $
|
** $Id: lcode.c,v 2.100 2015/03/28 19:14:47 roberto Exp roberto $
|
||||||
** Code generator for Lua
|
** Code generator for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -29,8 +29,8 @@
|
|||||||
#include "lvm.h"
|
#include "lvm.h"
|
||||||
|
|
||||||
|
|
||||||
/* Maximum number of registers in a Lua function */
|
/* Maximum number of registers in a Lua function (must fit in 8 bits) */
|
||||||
#define MAXREGS 250
|
#define MAXREGS 255
|
||||||
|
|
||||||
|
|
||||||
#define hasjumps(e) ((e)->t != (e)->f)
|
#define hasjumps(e) ((e)->t != (e)->f)
|
||||||
@ -279,7 +279,8 @@ void luaK_checkstack (FuncState *fs, int n) {
|
|||||||
int newstack = fs->freereg + n;
|
int newstack = fs->freereg + n;
|
||||||
if (newstack > fs->f->maxstacksize) {
|
if (newstack > fs->f->maxstacksize) {
|
||||||
if (newstack >= MAXREGS)
|
if (newstack >= MAXREGS)
|
||||||
luaX_syntaxerror(fs->ls, "function or expression too complex");
|
luaX_syntaxerror(fs->ls,
|
||||||
|
"function or expression needs too many registers");
|
||||||
fs->f->maxstacksize = cast_byte(newstack);
|
fs->f->maxstacksize = cast_byte(newstack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user