lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 491103708e5516c94fa3e1af0af3a52065c40959
parent fa4d5c86895fa176c4d7435a23d48a053b15b176
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 27 Oct 2014 14:29:33 -0200

'MAXSTACK' -> 'MAXREGS' and moved to 'lcode.c' (there is no reason
to change that constant...)

Diffstat:
Mlcode.c | 8++++++--
Mllimits.h | 6+-----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lcode.c b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.90 2014/05/08 18:58:46 roberto Exp roberto $ +** $Id: lcode.c,v 2.91 2014/10/25 11:50:46 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -27,6 +27,10 @@ #include "lvm.h" +/* Maximum number of registers in a Lua function */ +#define MAXREGS 250 + + /* test for x == -0 */ #if defined(signbit) #define isminuszero(x) ((x) == 0.0 && signbit(x)) @@ -280,7 +284,7 @@ int luaK_codek (FuncState *fs, int reg, int k) { void luaK_checkstack (FuncState *fs, int n) { int newstack = fs->freereg + n; if (newstack > fs->f->maxstacksize) { - if (newstack >= MAXSTACK) + if (newstack >= MAXREGS) luaX_syntaxerror(fs->ls, "function or expression too complex"); fs->f->maxstacksize = cast_byte(newstack); } diff --git a/llimits.h b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.120 2014/07/18 18:29:12 roberto Exp roberto $ +** $Id: llimits.h,v 1.121 2014/10/25 11:50:46 roberto Exp roberto $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -156,10 +156,6 @@ typedef lu_int32 Instruction; -/* maximum stack for a Lua function */ -#define MAXSTACK 250 - - /* minimum size for the string table (must be power of 2) */ #if !defined(MINSTRTABSIZE)