summaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-05-08 16:32:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-05-08 16:32:53 -0300
commit11a70220670f25a9929439f0b27331f09f05235c (patch)
treec4a962b5a3e53ac6df8894fb3ad2248c4a1256cb /lcode.c
parent35a6ed283881f313152457f24cc6c677122d5058 (diff)
downloadlua-github-11a70220670f25a9929439f0b27331f09f05235c.tar.gz
global variables are stored in a Lua table
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lcode.c b/lcode.c
index 296d5cf3..b5ef968e 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.c,v 1.27 2000/04/17 14:05:34 roberto Exp roberto $
+** $Id: lcode.c,v 1.28 2000/04/19 13:41:37 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -16,7 +16,6 @@
#include "lobject.h"
#include "lopcodes.h"
#include "lparser.h"
-#include "lstring.h"
void luaK_error (LexState *ls, const char *msg) {
@@ -148,11 +147,6 @@ void luaK_setcallreturns (FuncState *fs, int nresults) {
}
-static void assertglobal (FuncState *fs, int index) {
- luaS_assertglobal(fs->L, fs->f->kstr[index]);
-}
-
-
static int discharge (FuncState *fs, expdesc *var) {
switch (var->k) {
case VLOCAL:
@@ -160,7 +154,6 @@ static int discharge (FuncState *fs, expdesc *var) {
break;
case VGLOBAL:
luaK_code1(fs, OP_GETGLOBAL, var->u.index);
- assertglobal(fs, var->u.index); /* make sure that there is a global */
break;
case VINDEXED:
luaK_code0(fs, OP_GETTABLE);
@@ -190,7 +183,6 @@ void luaK_storevar (LexState *ls, const expdesc *var) {
break;
case VGLOBAL:
luaK_code1(fs, OP_SETGLOBAL, var->u.index);
- assertglobal(fs, var->u.index); /* make sure that there is a global */
break;
case VINDEXED: /* table is at top-3; pop 3 elements after operation */
luaK_code2(fs, OP_SETTABLE, 3, 3);