diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-04-29 15:24:11 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-04-29 15:24:11 -0300 |
commit | a1935b9cba4ba4619028e2257e8367f054ce7af8 (patch) | |
tree | 380399433a07351aad490445bf744d848f27dacc | |
parent | 513c639bf91cbf7bcd11b37582a7adb897970b8d (diff) | |
download | lua-a1935b9cba4ba4619028e2257e8367f054ce7af8.tar.gz lua-a1935b9cba4ba4619028e2257e8367f054ce7af8.tar.bz2 lua-a1935b9cba4ba4619028e2257e8367f054ce7af8.zip |
error message ("too complex" -> "too many registers") + MAXREGS
changed to 255 (no reason not to use maximum allowed)
-rw-r--r-- | lcode.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.99 2014/12/29 16:49:25 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.100 2015/03/28 19:14:47 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -29,8 +29,8 @@ | |||
29 | #include "lvm.h" | 29 | #include "lvm.h" |
30 | 30 | ||
31 | 31 | ||
32 | /* Maximum number of registers in a Lua function */ | 32 | /* Maximum number of registers in a Lua function (must fit in 8 bits) */ |
33 | #define MAXREGS 250 | 33 | #define MAXREGS 255 |
34 | 34 | ||
35 | 35 | ||
36 | #define hasjumps(e) ((e)->t != (e)->f) | 36 | #define hasjumps(e) ((e)->t != (e)->f) |
@@ -279,7 +279,8 @@ void luaK_checkstack (FuncState *fs, int n) { | |||
279 | int newstack = fs->freereg + n; | 279 | int newstack = fs->freereg + n; |
280 | if (newstack > fs->f->maxstacksize) { | 280 | if (newstack > fs->f->maxstacksize) { |
281 | if (newstack >= MAXREGS) | 281 | if (newstack >= MAXREGS) |
282 | luaX_syntaxerror(fs->ls, "function or expression too complex"); | 282 | luaX_syntaxerror(fs->ls, |
283 | "function or expression needs too many registers"); | ||
283 | fs->f->maxstacksize = cast_byte(newstack); | 284 | fs->f->maxstacksize = cast_byte(newstack); |
284 | } | 285 | } |
285 | } | 286 | } |