diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-10-09 15:45:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-10-09 15:45:59 -0300 |
commit | 36a7fda014d59ef14ca1fcbcf5bb38141495f11f (patch) | |
tree | 635534bfca490e8f411df2297205f0e8d7aef339 /opcode.c | |
parent | 1bb3fb73cc65d35df9cd737f4445ad9361f85775 (diff) | |
download | lua-36a7fda014d59ef14ca1fcbcf5bb38141495f11f.tar.gz lua-36a7fda014d59ef14ca1fcbcf5bb38141495f11f.tar.bz2 lua-36a7fda014d59ef14ca1fcbcf5bb38141495f11f.zip |
bug: stack overflow error must leave space on the stack for error function.
Diffstat (limited to 'opcode.c')
-rw-r--r-- | opcode.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.40 1995/10/04 14:20:26 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.41 1995/10/09 13:10:20 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
@@ -91,13 +91,11 @@ static void growstack (void) | |||
91 | else | 91 | else |
92 | { | 92 | { |
93 | Long maxstack = stackLimit - stack; | 93 | Long maxstack = stackLimit - stack; |
94 | if (maxstack >= MAX_INT) | ||
95 | lua_error("stack size overflow"); | ||
96 | maxstack *= 2; | 94 | maxstack *= 2; |
97 | if (maxstack >= MAX_INT) | ||
98 | maxstack = MAX_INT; | ||
99 | stack = growvector(stack, maxstack, Object); | 95 | stack = growvector(stack, maxstack, Object); |
100 | stackLimit = stack+maxstack; | 96 | stackLimit = stack+maxstack; |
97 | if (maxstack >= MAX_WORD/2) | ||
98 | lua_error("stack size overflow"); | ||
101 | } | 99 | } |
102 | top = stack + t; | 100 | top = stack + t; |
103 | } | 101 | } |