This commit is contained in:
Roberto Ierusalimschy 2003-11-19 17:59:18 -02:00
parent 57b6ed6815
commit 8bc6c68021
2 changed files with 12 additions and 12 deletions

16
lcode.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 1.119 2003/08/27 20:58:52 roberto Exp $
** $Id: lcode.c,v 1.119 2003/08/27 21:01:44 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@ -418,25 +418,25 @@ int luaK_exp2RK (FuncState *fs, expdesc *e) {
}
void luaK_storevar (FuncState *fs, expdesc *var, expdesc *exp) {
void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {
switch (var->k) {
case VLOCAL: {
freeexp(fs, exp);
luaK_exp2reg(fs, exp, var->info);
freeexp(fs, ex);
luaK_exp2reg(fs, ex, var->info);
return;
}
case VUPVAL: {
int e = luaK_exp2anyreg(fs, exp);
int e = luaK_exp2anyreg(fs, ex);
luaK_codeABC(fs, OP_SETUPVAL, e, var->info, 0);
break;
}
case VGLOBAL: {
int e = luaK_exp2anyreg(fs, exp);
int e = luaK_exp2anyreg(fs, ex);
luaK_codeABx(fs, OP_SETGLOBAL, e, var->info);
break;
}
case VINDEXED: {
int e = luaK_exp2RK(fs, exp);
int e = luaK_exp2RK(fs, ex);
luaK_codeABC(fs, OP_SETTABLE, var->info, var->aux, e);
break;
}
@ -445,7 +445,7 @@ void luaK_storevar (FuncState *fs, expdesc *var, expdesc *exp) {
break;
}
}
freeexp(fs, exp);
freeexp(fs, ex);
}

View File

@ -1,5 +1,5 @@
/*
** $Id: ltests.c,v 1.167 2003/10/20 12:25:23 roberto Exp roberto $
** $Id: ltests.c,v 1.168 2003/11/05 11:59:14 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@ -354,21 +354,21 @@ static int tref (lua_State *L) {
luaL_checkany(L, 1);
lua_pushvalue(L, 1);
lua_pushinteger(L, lua_ref(L, lock));
assert(lua_gettop(L) == level+1); /* +1 for result */
lua_assert(lua_gettop(L) == level+1); /* +1 for result */
return 1;
}
static int getref (lua_State *L) {
int level = lua_gettop(L);
lua_getref(L, luaL_checkint(L, 1));
assert(lua_gettop(L) == level+1);
lua_assert(lua_gettop(L) == level+1);
return 1;
}
static int unref (lua_State *L) {
int level = lua_gettop(L);
lua_unref(L, luaL_checkint(L, 1));
assert(lua_gettop(L) == level);
lua_assert(lua_gettop(L) == level);
return 0;
}