aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-19 09:45:25 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-19 09:45:25 -0300
commit938092489b9df19c9da7481c68d74dd7e0104949 (patch)
tree0f7ce5978e29afb39677045e817a850f23148215 /lvm.c
parent578d1da00d4144caaf2ea7406680f76adcfc5af1 (diff)
downloadlua-938092489b9df19c9da7481c68d74dd7e0104949.tar.gz
lua-938092489b9df19c9da7481c68d74dd7e0104949.tar.bz2
lua-938092489b9df19c9da7481c68d74dd7e0104949.zip
erroneous objects may not live in the stack
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lvm.c b/lvm.c
index 7058af88..5a9cfc11 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.218 2002/03/04 21:33:09 roberto Exp roberto $ 2** $Id: lvm.c,v 1.219 2002/03/08 19:10:32 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -125,7 +125,7 @@ static void callTM (lua_State *L, const TObject *f,
125** Receives the table at `t' and the key at `key'. 125** Receives the table at `t' and the key at `key'.
126** leaves the result at `res'. 126** leaves the result at `res'.
127*/ 127*/
128void luaV_gettable (lua_State *L, StkId t, TObject *key, StkId res) { 128void luaV_gettable (lua_State *L, const TObject *t, TObject *key, StkId res) {
129 const TObject *tm; 129 const TObject *tm;
130 int loop = 0; 130 int loop = 0;
131 init: 131 init:
@@ -151,7 +151,7 @@ void luaV_gettable (lua_State *L, StkId t, TObject *key, StkId res) {
151 callTMres(L, tm, t, key, res); 151 callTMres(L, tm, t, key, res);
152 else { 152 else {
153 if (++loop == MAXTAGLOOP) luaD_error(L, "loop in gettable"); 153 if (++loop == MAXTAGLOOP) luaD_error(L, "loop in gettable");
154 t = (StkId)tm; /* ?? */ 154 t = tm;
155 goto init; /* return luaV_gettable(L, tm, key, res); */ 155 goto init; /* return luaV_gettable(L, tm, key, res); */
156 } 156 }
157} 157}
@@ -160,7 +160,7 @@ void luaV_gettable (lua_State *L, StkId t, TObject *key, StkId res) {
160/* 160/*
161** Receives table at `t', key at `key' and value at `val'. 161** Receives table at `t', key at `key' and value at `val'.
162*/ 162*/
163void luaV_settable (lua_State *L, StkId t, TObject *key, StkId val) { 163void luaV_settable (lua_State *L, const TObject *t, TObject *key, StkId val) {
164 const TObject *tm; 164 const TObject *tm;
165 int loop = 0; 165 int loop = 0;
166 init: 166 init:
@@ -181,7 +181,7 @@ void luaV_settable (lua_State *L, StkId t, TObject *key, StkId val) {
181 callTM(L, tm, t, key, val); 181 callTM(L, tm, t, key, val);
182 else { 182 else {
183 if (++loop == MAXTAGLOOP) luaD_error(L, "loop in settable"); 183 if (++loop == MAXTAGLOOP) luaD_error(L, "loop in settable");
184 t = (StkId)tm; /* ?? */ 184 t = tm;
185 goto init; /* luaV_settable(L, tm, key, val); */ 185 goto init; /* luaV_settable(L, tm, key, val); */
186 } 186 }
187} 187}
@@ -198,7 +198,7 @@ static int call_binTM (lua_State *L, const TObject *p1, const TObject *p2,
198} 198}
199 199
200 200
201static void call_arith (lua_State *L, StkId p1, TObject *p2, 201static void call_arith (lua_State *L, StkId p1, const TObject *p2,
202 StkId res, TMS event) { 202 StkId res, TMS event) {
203 if (!call_binTM(L, p1, p2, res, event)) 203 if (!call_binTM(L, p1, p2, res, event))
204 luaG_aritherror(L, p1, p2); 204 luaG_aritherror(L, p1, p2);