commit 8d2baf719cf8687dba1648da4c5d9450d0bb2c14
parent 88657809acdfd51f3ff92b66a48699045b72902e
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 19 Jun 2000 15:04:19 -0300
comment
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lvm.c b/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 1.114 2000/06/08 17:48:31 roberto Exp roberto $
+** $Id: lvm.c,v 1.115 2000/06/12 13:52:05 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -180,8 +180,10 @@ void luaV_setglobal (lua_State *L, TString *s, StkId top) {
const TObject *oldvalue = luaH_getstr(L->gt, s);
const TObject *im = luaT_getimbyObj(L, oldvalue, IM_SETGLOBAL);
if (ttype(im) == TAG_NIL) { /* is there a tag method? */
- if (oldvalue != &luaO_nilobject)
+ if (oldvalue != &luaO_nilobject) {
+ /* cast to remove `const' is OK, because `oldvalue' != luaO_nilobject */
*(TObject *)oldvalue = *(top-1);
+ }
else {
TObject key;
ttype(&key) = TAG_STRING;