From a8220feed2abf715b1708c76eb2a897585763faa Mon Sep 17 00:00:00 2001 From: Waldemar Celes Date: Tue, 27 Dec 1994 18:41:11 -0200 Subject: bytecodes are indexed by integers, not Words, to allow bigger code on 32 bit machines --- lua.stx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lua.stx b/lua.stx index 2742da2e..451532d5 100644 --- a/lua.stx +++ b/lua.stx @@ -1,6 +1,6 @@ %{ -char *rcs_luastx = "$Id: lua.stx,v 3.14 1994/12/20 21:20:36 roberto Exp celes $"; +char *rcs_luastx = "$Id: lua.stx,v 3.15 1994/12/27 20:04:29 celes Exp celes $"; #include #include @@ -14,14 +14,12 @@ char *rcs_luastx = "$Id: lua.stx,v 3.14 1994/12/20 21:20:36 roberto Exp celes $" #include "table.h" #include "lua.h" - /* to avoid warnings generated by yacc */ int yyparse (void); #define malloc luaI_malloc #define realloc luaI_realloc #define free luaI_free - #ifndef LISTING #define LISTING 0 #endif @@ -29,14 +27,14 @@ int yyparse (void); #ifndef CODE_BLOCK #define CODE_BLOCK 256 #endif -static Word maxcode; -static Word maxmain; +static int maxcode; +static int maxmain; static Long maxcurr; /* to allow maxcurr *= 2 without overflow */ static Byte *funcCode = NULL; static Byte **initcode; static Byte *basepc; -static Word maincode; -static Word pc; +static int maincode; +static int pc; #define MAXVAR 32 static Long varbuffer[MAXVAR]; /* variables in an assignment list; @@ -57,11 +55,11 @@ static void code_byte (Byte c) { if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */ { - if (maxcurr >= MAX_WORD) + if (maxcurr >= MAX_INT) lua_error("code size overflow"); maxcurr *= 2; - if (maxcurr >= MAX_WORD) - maxcurr = MAX_WORD; + if (maxcurr >= MAX_INT) + maxcurr = MAX_INT; basepc = growvector(basepc, maxcurr, Byte); } basepc[pc++] = c; -- cgit v1.2.3-55-g6feb