diff options
Diffstat (limited to 'lua.stx')
-rw-r--r-- | lua.stx | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -1,6 +1,6 @@ | |||
1 | %{ | 1 | %{ |
2 | 2 | ||
3 | char *rcs_luastx = "$Id: lua.stx,v 3.34 1996/02/26 21:00:27 roberto Exp roberto $"; | 3 | char *rcs_luastx = "$Id: lua.stx,v 3.35 1996/03/08 12:02:37 roberto Exp roberto $"; |
4 | 4 | ||
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
@@ -31,7 +31,7 @@ int yyparse (void); | |||
31 | #endif | 31 | #endif |
32 | static int maxcode; | 32 | static int maxcode; |
33 | static int maxmain; | 33 | static int maxmain; |
34 | static Long maxcurr; /* to allow maxcurr *= 2 without overflow */ | 34 | static int maxcurr; |
35 | static Byte *funcCode = NULL; | 35 | static Byte *funcCode = NULL; |
36 | static Byte **initcode; | 36 | static Byte **initcode; |
37 | static Byte *basepc; | 37 | static Byte *basepc; |
@@ -70,14 +70,7 @@ static void yyerror (char *s) | |||
70 | static void code_byte (Byte c) | 70 | static void code_byte (Byte c) |
71 | { | 71 | { |
72 | if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */ | 72 | if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */ |
73 | { | 73 | maxcurr = growvector(&basepc, maxcurr, Byte, codeEM, MAX_INT); |
74 | if (maxcurr >= MAX_INT) | ||
75 | yyerror("code size overflow"); | ||
76 | maxcurr *= 2; | ||
77 | if (maxcurr >= MAX_INT) | ||
78 | maxcurr = MAX_INT; | ||
79 | basepc = growvector(basepc, maxcurr, Byte); | ||
80 | } | ||
81 | basepc[pc++] = c; | 74 | basepc[pc++] = c; |
82 | } | 75 | } |
83 | 76 | ||