diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-12-30 15:45:11 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-12-30 15:45:11 -0200 |
commit | 5b8ced84b4bd5ec300d3658b2ddb48d715512732 (patch) | |
tree | 729ad9e5e144dac1a62e6c86fb2716b82ebcdb94 | |
parent | df3a81ec88cdab5afca66e550c9bd768c21963e2 (diff) | |
download | lua-5b8ced84b4bd5ec300d3658b2ddb48d715512732.tar.gz lua-5b8ced84b4bd5ec300d3658b2ddb48d715512732.tar.bz2 lua-5b8ced84b4bd5ec300d3658b2ddb48d715512732.zip |
stack is indexed by integers, not Words, to allow bigger stack on 32 bit machines
-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 | } |