diff options
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.230 2002/05/09 14:14:34 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.231 2002/05/13 13:09:00 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 | */ |
@@ -134,7 +134,7 @@ void luaV_gettable (lua_State *L, const TObject *t, TObject *key, StkId res) { | |||
134 | if (ttype(tm) == LUA_TFUNCTION) | 134 | if (ttype(tm) == LUA_TFUNCTION) |
135 | callTMres(L, tm, t, key, res); | 135 | callTMres(L, tm, t, key, res); |
136 | else { | 136 | else { |
137 | if (++loop == MAXTAGLOOP) luaD_runerror(L, "loop in gettable"); | 137 | if (++loop == MAXTAGLOOP) luaG_runerror(L, "loop in gettable"); |
138 | t = tm; | 138 | t = tm; |
139 | goto init; /* return luaV_gettable(L, tm, key, res); */ | 139 | goto init; /* return luaV_gettable(L, tm, key, res); */ |
140 | } | 140 | } |
@@ -164,7 +164,7 @@ void luaV_settable (lua_State *L, const TObject *t, TObject *key, StkId val) { | |||
164 | if (ttype(tm) == LUA_TFUNCTION) | 164 | if (ttype(tm) == LUA_TFUNCTION) |
165 | callTM(L, tm, t, key, val); | 165 | callTM(L, tm, t, key, val); |
166 | else { | 166 | else { |
167 | if (++loop == MAXTAGLOOP) luaD_runerror(L, "loop in settable"); | 167 | if (++loop == MAXTAGLOOP) luaG_runerror(L, "loop in settable"); |
168 | t = tm; | 168 | t = tm; |
169 | goto init; /* luaV_settable(L, tm, key, val); */ | 169 | goto init; /* luaV_settable(L, tm, key, val); */ |
170 | } | 170 | } |
@@ -251,7 +251,7 @@ void luaV_strconc (lua_State *L, int total, int last) { | |||
251 | tl += tsvalue(top-n-1)->tsv.len; | 251 | tl += tsvalue(top-n-1)->tsv.len; |
252 | n++; | 252 | n++; |
253 | } | 253 | } |
254 | if (tl > MAX_SIZET) luaD_runerror(L, "string size overflow"); | 254 | if (tl > MAX_SIZET) luaG_runerror(L, "string size overflow"); |
255 | buffer = luaO_openspace(L, tl, char); | 255 | buffer = luaO_openspace(L, tl, char); |
256 | tl = 0; | 256 | tl = 0; |
257 | for (i=n; i>0; i--) { /* concat all strings */ | 257 | for (i=n; i>0; i--) { /* concat all strings */ |
@@ -276,7 +276,7 @@ static void powOp (lua_State *L, StkId ra, StkId rb, StkId rc) { | |||
276 | setsvalue(&o, luaS_newliteral(L, "pow")); | 276 | setsvalue(&o, luaS_newliteral(L, "pow")); |
277 | luaV_gettable(L, gt(L), &o, &f); | 277 | luaV_gettable(L, gt(L), &o, &f); |
278 | if (ttype(&f) != LUA_TFUNCTION) | 278 | if (ttype(&f) != LUA_TFUNCTION) |
279 | luaD_runerror(L, "`pow' (for `^' operator) is not a function"); | 279 | luaG_runerror(L, "`pow' (for `^' operator) is not a function"); |
280 | callTMres(L, &f, b, c, ra); | 280 | callTMres(L, &f, b, c, ra); |
281 | } | 281 | } |
282 | else | 282 | else |
@@ -527,11 +527,11 @@ StkId luaV_execute (lua_State *L) { | |||
527 | const TObject *plimit = ra+1; | 527 | const TObject *plimit = ra+1; |
528 | const TObject *pstep = ra+2; | 528 | const TObject *pstep = ra+2; |
529 | if (ttype(ra) != LUA_TNUMBER) | 529 | if (ttype(ra) != LUA_TNUMBER) |
530 | luaD_runerror(L, "`for' initial value must be a number"); | 530 | luaG_runerror(L, "`for' initial value must be a number"); |
531 | if (!tonumber(plimit, ra+1)) | 531 | if (!tonumber(plimit, ra+1)) |
532 | luaD_runerror(L, "`for' limit must be a number"); | 532 | luaG_runerror(L, "`for' limit must be a number"); |
533 | if (!tonumber(pstep, ra+2)) | 533 | if (!tonumber(pstep, ra+2)) |
534 | luaD_runerror(L, "`for' step must be a number"); | 534 | luaG_runerror(L, "`for' step must be a number"); |
535 | step = nvalue(pstep); | 535 | step = nvalue(pstep); |
536 | index = nvalue(ra) + step; /* increment index */ | 536 | index = nvalue(ra) + step; /* increment index */ |
537 | limit = nvalue(plimit); | 537 | limit = nvalue(plimit); |