From 36a7fda014d59ef14ca1fcbcf5bb38141495f11f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 9 Oct 1995 15:45:59 -0300 Subject: bug: stack overflow error must leave space on the stack for error function. --- opcode.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/opcode.c b/opcode.c index 1fb831c7..edf8d4c4 100644 --- a/opcode.c +++ b/opcode.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_opcode="$Id: opcode.c,v 3.40 1995/10/04 14:20:26 roberto Exp roberto $"; +char *rcs_opcode="$Id: opcode.c,v 3.41 1995/10/09 13:10:20 roberto Exp roberto $"; #include #include @@ -91,13 +91,11 @@ static void growstack (void) else { Long maxstack = stackLimit - stack; - if (maxstack >= MAX_INT) - lua_error("stack size overflow"); maxstack *= 2; - if (maxstack >= MAX_INT) - maxstack = MAX_INT; stack = growvector(stack, maxstack, Object); stackLimit = stack+maxstack; + if (maxstack >= MAX_WORD/2) + lua_error("stack size overflow"); } top = stack + t; } -- cgit v1.2.3-55-g6feb