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

to change that constant...)
This commit is contained in:
Roberto Ierusalimschy
2014-10-27 14:29:58 -02:00
parent fa4d5c8689
commit 491103708e
2 changed files with 7 additions and 7 deletions

View File

@@ -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);
}