aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorbellard <bellard>2004-11-02 21:55:13 +0000
committerbellard <bellard>2004-11-02 21:55:13 +0000
commit1d0e5e8b01f24b2416d5ad1ee98544a4b1ba8dab (patch)
treea5a08557eb4c759d07703ca630340bcbb6483bb3 /tcc.c
parent1e1d3ff68775f62d2b212ec1de7469695ed1ef12 (diff)
downloadtinycc-1d0e5e8b01f24b2416d5ad1ee98544a4b1ba8dab.tar.gz
tinycc-1d0e5e8b01f24b2416d5ad1ee98544a4b1ba8dab.tar.bz2
stack full fix
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tcc.c b/tcc.c
index e3cceae..5a8e832 100644
--- a/tcc.c
+++ b/tcc.c
@@ -111,7 +111,7 @@ typedef int BOOL;
#define INCLUDE_STACK_SIZE 32
#define IFDEF_STACK_SIZE 64
-#define VSTACK_SIZE 64
+#define VSTACK_SIZE 256
#define STRING_MAX_SIZE 1024
#define TOK_HASH_SIZE 8192 /* must be a power of two */
@@ -4266,7 +4266,7 @@ void vsetc(CType *type, int r, CValue *vc)
{
int v;
- if (vtop >= vstack + VSTACK_SIZE)
+ if (vtop >= vstack + (VSTACK_SIZE - 1))
error("memory full");
/* cannot let cpu flags if other instruction are generated. Also
avoid leaving VT_JMP anywhere except on the top of the stack
@@ -4387,7 +4387,7 @@ void vswap(void)
void vpushv(SValue *v)
{
- if (vtop >= vstack + VSTACK_SIZE)
+ if (vtop >= vstack + (VSTACK_SIZE - 1))
error("memory full");
vtop++;
*vtop = *v;