aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lcode.c b/lcode.c
index bd39e46b..81007955 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.90 2014/05/08 18:58:46 roberto Exp roberto $ 2** $Id: lcode.c,v 2.91 2014/10/25 11:50:46 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*/
@@ -27,6 +27,10 @@
27#include "lvm.h" 27#include "lvm.h"
28 28
29 29
30/* Maximum number of registers in a Lua function */
31#define MAXREGS 250
32
33
30/* test for x == -0 */ 34/* test for x == -0 */
31#if defined(signbit) 35#if defined(signbit)
32#define isminuszero(x) ((x) == 0.0 && signbit(x)) 36#define isminuszero(x) ((x) == 0.0 && signbit(x))
@@ -280,7 +284,7 @@ int luaK_codek (FuncState *fs, int reg, int k) {
280void luaK_checkstack (FuncState *fs, int n) { 284void luaK_checkstack (FuncState *fs, int n) {
281 int newstack = fs->freereg + n; 285 int newstack = fs->freereg + n;
282 if (newstack > fs->f->maxstacksize) { 286 if (newstack > fs->f->maxstacksize) {
283 if (newstack >= MAXSTACK) 287 if (newstack >= MAXREGS)
284 luaX_syntaxerror(fs->ls, "function or expression too complex"); 288 luaX_syntaxerror(fs->ls, "function or expression too complex");
285 fs->f->maxstacksize = cast_byte(newstack); 289 fs->f->maxstacksize = cast_byte(newstack);
286 } 290 }