commit a8220feed2abf715b1708c76eb2a897585763faa
parent 8bc4b0d741f73109e761e73a7932f8fe47b242d5
Author: Waldemar Celes <celes@tecgraf.puc-rio.br>
Date: Tue, 27 Dec 1994 18:40:52 -0200
bytecodes are indexed by integers, not Words, to allow bigger code on 32 bit machines
Diffstat:
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git 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 <stdio.h>
#include <stdlib.h>
@@ -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;