diff options
| -rw-r--r-- | opcode.c | 8 |
1 files changed, 6 insertions, 2 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.29 1994/12/27 20:53:15 celes Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.30 1994/12/28 12:55:47 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| @@ -24,7 +24,7 @@ char *rcs_opcode="$Id: opcode.c,v 3.29 1994/12/27 20:53:15 celes Exp roberto $"; | |||
| 24 | 24 | ||
| 25 | #define STACK_BUFFER (STACKGAP+128) | 25 | #define STACK_BUFFER (STACKGAP+128) |
| 26 | 26 | ||
| 27 | typedef unsigned int StkId; /* index to stack elements */ | 27 | typedef int StkId; /* index to stack elements */ |
| 28 | 28 | ||
| 29 | static Long maxstack = 0L; | 29 | static Long maxstack = 0L; |
| 30 | static Object *stack = NULL; | 30 | static Object *stack = NULL; |
| @@ -103,8 +103,12 @@ static void lua_checkstack (StkId n) | |||
| 103 | StkId t; | 103 | StkId t; |
| 104 | if (stack == NULL) | 104 | if (stack == NULL) |
| 105 | lua_initstack(); | 105 | lua_initstack(); |
| 106 | if (maxstack >= MAX_INT) | ||
| 107 | lua_error("stack size overflow"); | ||
| 106 | t = top-stack; | 108 | t = top-stack; |
| 107 | maxstack *= 2; | 109 | maxstack *= 2; |
| 110 | if (maxstack >= MAX_INT) | ||
| 111 | maxstack = MAX_INT; | ||
| 108 | stack = growvector(stack, maxstack, Object); | 112 | stack = growvector(stack, maxstack, Object); |
| 109 | top = stack + t; | 113 | top = stack + t; |
| 110 | } | 114 | } |
