mirror of
https://github.com/lua/lua
synced 2025-02-07 08:44:01 +03:00
'MAXSTACK' -> 'MAXREGS' and moved to 'lcode.c' (there is no reason
to change that constant...)
This commit is contained in:
parent
fa4d5c8689
commit
491103708e
8
lcode.c
8
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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user