diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-15 15:57:44 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-15 15:57:44 -0300 |
commit | b7a0503c1d72603b8f7e480f2abecbc05348cb69 (patch) | |
tree | bfac646fea320f73abec2ee57a0c96a704452884 /ldo.c | |
parent | 1c328a191a8b86b7ad601cb9a935f1da5373fdf7 (diff) | |
download | lua-b7a0503c1d72603b8f7e480f2abecbc05348cb69.tar.gz lua-b7a0503c1d72603b8f7e480f2abecbc05348cb69.tar.bz2 lua-b7a0503c1d72603b8f7e480f2abecbc05348cb69.zip |
new format for error messages
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.173 2002/05/01 20:40:42 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.174 2002/05/07 17:36:56 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -113,7 +113,7 @@ static void luaD_growCI (lua_State *L) { | |||
113 | else { | 113 | else { |
114 | luaD_reallocCI(L, 2*L->size_ci); | 114 | luaD_reallocCI(L, 2*L->size_ci); |
115 | if (L->size_ci > LUA_MAXCALLS) | 115 | if (L->size_ci > LUA_MAXCALLS) |
116 | luaD_runerror(L, "stack overflow"); | 116 | luaG_runerror(L, "stack overflow"); |
117 | } | 117 | } |
118 | L->ci++; | 118 | L->ci++; |
119 | } | 119 | } |
@@ -279,7 +279,7 @@ void luaD_call (lua_State *L, StkId func, int nResults) { | |||
279 | firstResult = luaV_execute(L); /* call it */ | 279 | firstResult = luaV_execute(L); /* call it */ |
280 | if (firstResult == NULL) { | 280 | if (firstResult == NULL) { |
281 | luaD_poscall(L, 0, L->top); | 281 | luaD_poscall(L, 0, L->top); |
282 | luaD_runerror(L, "attempt to `yield' across tag-method/C-call boundary"); | 282 | luaG_runerror(L, "attempt to `yield' across tag-method/C-call boundary"); |
283 | } | 283 | } |
284 | } | 284 | } |
285 | luaD_poscall(L, nResults, firstResult); | 285 | luaD_poscall(L, nResults, firstResult); |
@@ -335,9 +335,9 @@ LUA_API int lua_resume (lua_State *L, lua_State *co) { | |||
335 | lua_lock(L); | 335 | lua_lock(L); |
336 | ci = co->ci; | 336 | ci = co->ci; |
337 | if (ci == co->base_ci) /* no activation record? ?? */ | 337 | if (ci == co->base_ci) /* no activation record? ?? */ |
338 | luaD_runerror(L, "thread is dead - cannot be resumed"); | 338 | luaG_runerror(L, "thread is dead - cannot be resumed"); |
339 | if (co->errorJmp != NULL) /* ?? */ | 339 | if (co->errorJmp != NULL) /* ?? */ |
340 | luaD_runerror(L, "thread is active - cannot be resumed"); | 340 | luaG_runerror(L, "thread is active - cannot be resumed"); |
341 | if (L->errorJmp) { | 341 | if (L->errorJmp) { |
342 | setobj(&ud.err, L->errorJmp->err); | 342 | setobj(&ud.err, L->errorJmp->err); |
343 | } | 343 | } |
@@ -359,7 +359,7 @@ LUA_API int lua_yield (lua_State *L, int nresults) { | |||
359 | lua_lock(L); | 359 | lua_lock(L); |
360 | ci = L->ci; | 360 | ci = L->ci; |
361 | if (ci_func(ci-1)->c.isC) | 361 | if (ci_func(ci-1)->c.isC) |
362 | luaD_runerror(L, "cannot `yield' a C function"); | 362 | luaG_runerror(L, "cannot `yield' a C function"); |
363 | ci->yield_results = nresults; | 363 | ci->yield_results = nresults; |
364 | lua_unlock(L); | 364 | lua_unlock(L); |
365 | return -1; | 365 | return -1; |
@@ -492,11 +492,6 @@ void luaD_error (lua_State *L, const char *s, int errcode) { | |||
492 | } | 492 | } |
493 | 493 | ||
494 | 494 | ||
495 | void luaD_runerror (lua_State *L, const char *s) { | ||
496 | luaD_error(L, s, LUA_ERRRUN); | ||
497 | } | ||
498 | |||
499 | |||
500 | int luaD_runprotected (lua_State *L, Pfunc f, TObject *ud) { | 495 | int luaD_runprotected (lua_State *L, Pfunc f, TObject *ud) { |
501 | struct lua_longjmp lj; | 496 | struct lua_longjmp lj; |
502 | lj.ci = L->ci; | 497 | lj.ci = L->ci; |