|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
-** $Id: lvm.c,v 1.224 2002/04/09 19:47:44 roberto Exp roberto $
|
|
|
|
|
|
+** $Id: lvm.c,v 1.225 2002/04/10 12:11:07 roberto Exp roberto $
|
|
** Lua virtual machine
|
|
** Lua virtual machine
|
|
** See Copyright Notice in lua.h
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
*/
|
|
@@ -134,7 +134,7 @@ void luaV_gettable (lua_State *L, const TObject *t, TObject *key, StkId res) {
|
|
if (ttype(tm) == LUA_TFUNCTION)
|
|
if (ttype(tm) == LUA_TFUNCTION)
|
|
callTMres(L, tm, t, key, res);
|
|
callTMres(L, tm, t, key, res);
|
|
else {
|
|
else {
|
|
- if (++loop == MAXTAGLOOP) luaD_error(L, "loop in gettable");
|
|
|
|
|
|
+ if (++loop == MAXTAGLOOP) luaD_runerror(L, "loop in gettable");
|
|
t = tm;
|
|
t = tm;
|
|
goto init; /* return luaV_gettable(L, tm, key, res); */
|
|
goto init; /* return luaV_gettable(L, tm, key, res); */
|
|
}
|
|
}
|
|
@@ -164,7 +164,7 @@ void luaV_settable (lua_State *L, const TObject *t, TObject *key, StkId val) {
|
|
if (ttype(tm) == LUA_TFUNCTION)
|
|
if (ttype(tm) == LUA_TFUNCTION)
|
|
callTM(L, tm, t, key, val);
|
|
callTM(L, tm, t, key, val);
|
|
else {
|
|
else {
|
|
- if (++loop == MAXTAGLOOP) luaD_error(L, "loop in settable");
|
|
|
|
|
|
+ if (++loop == MAXTAGLOOP) luaD_runerror(L, "loop in settable");
|
|
t = tm;
|
|
t = tm;
|
|
goto init; /* luaV_settable(L, tm, key, val); */
|
|
goto init; /* luaV_settable(L, tm, key, val); */
|
|
}
|
|
}
|
|
@@ -241,7 +241,7 @@ void luaV_strconc (lua_State *L, int total, int last) {
|
|
tl += tsvalue(top-n-1)->tsv.len;
|
|
tl += tsvalue(top-n-1)->tsv.len;
|
|
n++;
|
|
n++;
|
|
}
|
|
}
|
|
- if (tl > MAX_SIZET) luaD_error(L, "string size overflow");
|
|
|
|
|
|
+ if (tl > MAX_SIZET) luaD_runerror(L, "string size overflow");
|
|
buffer = luaO_openspace(L, tl, char);
|
|
buffer = luaO_openspace(L, tl, char);
|
|
tl = 0;
|
|
tl = 0;
|
|
for (i=n; i>0; i--) { /* concat all strings */
|
|
for (i=n; i>0; i--) { /* concat all strings */
|
|
@@ -266,7 +266,7 @@ static void powOp (lua_State *L, StkId ra, StkId rb, StkId rc) {
|
|
setsvalue(&o, luaS_newliteral(L, "pow"));
|
|
setsvalue(&o, luaS_newliteral(L, "pow"));
|
|
luaV_gettable(L, gt(L), &o, &f);
|
|
luaV_gettable(L, gt(L), &o, &f);
|
|
if (ttype(&f) != LUA_TFUNCTION)
|
|
if (ttype(&f) != LUA_TFUNCTION)
|
|
- luaD_error(L, "`pow' (for `^' operator) is not a function");
|
|
|
|
|
|
+ luaD_runerror(L, "`pow' (for `^' operator) is not a function");
|
|
callTMres(L, &f, b, c, ra);
|
|
callTMres(L, &f, b, c, ra);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -535,11 +535,11 @@ StkId luaV_execute (lua_State *L) {
|
|
const TObject *plimit = ra+1;
|
|
const TObject *plimit = ra+1;
|
|
const TObject *pstep = ra+2;
|
|
const TObject *pstep = ra+2;
|
|
if (ttype(ra) != LUA_TNUMBER)
|
|
if (ttype(ra) != LUA_TNUMBER)
|
|
- luaD_error(L, "`for' initial value must be a number");
|
|
|
|
|
|
+ luaD_runerror(L, "`for' initial value must be a number");
|
|
if (!tonumber(plimit, ra+1))
|
|
if (!tonumber(plimit, ra+1))
|
|
- luaD_error(L, "`for' limit must be a number");
|
|
|
|
|
|
+ luaD_runerror(L, "`for' limit must be a number");
|
|
if (!tonumber(pstep, ra+2))
|
|
if (!tonumber(pstep, ra+2))
|
|
- luaD_error(L, "`for' step must be a number");
|
|
|
|
|
|
+ luaD_runerror(L, "`for' step must be a number");
|
|
step = nvalue(pstep);
|
|
step = nvalue(pstep);
|
|
index = nvalue(ra) + step; /* increment index */
|
|
index = nvalue(ra) + step; /* increment index */
|
|
limit = nvalue(plimit);
|
|
limit = nvalue(plimit);
|