Mercurial > hg > qcc
changeset 336:edca71d60eba
[project @ 2004-11-02 21:55:13 by bellard]
stack full fix
author | bellard |
---|---|
date | Tue, 02 Nov 2004 21:55:13 +0000 |
parents | a3d817295f8d |
children | ab2fa6ee2e59 |
files | tcc.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tcc.c Fri Oct 29 23:55:13 2004 +0000 +++ b/tcc.c Tue Nov 02 21:55:13 2004 +0000 @@ -111,7 +111,7 @@ #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 @@ { 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 vpushv(SValue *v) { - if (vtop >= vstack + VSTACK_SIZE) + if (vtop >= vstack + (VSTACK_SIZE - 1)) error("memory full"); vtop++; *vtop = *v;