| 110 | |
| 111 | |
| 112 | void luaD_seterrorobj (lua_State *L, TStatus errcode, StkId oldtop) { |
| 113 | if (errcode == LUA_ERRMEM) { /* memory error? */ |
| 114 | setsvalue2s(L, oldtop, G(L)->memerrmsg); /* reuse preregistered msg. */ |
| 115 | } |
| 116 | else { |
| 117 | lua_assert(errorstatus(errcode)); /* must be a real error */ |
| 118 | lua_assert(!ttisnil(s2v(L->top.p - 1))); /* with a non-nil object */ |
| 119 | setobjs2s(L, oldtop, L->top.p - 1); /* move it to 'oldtop' */ |
| 120 | } |
| 121 | L->top.p = oldtop + 1; /* top goes back to old top plus error object */ |
| 122 | } |
| 123 | |
| 124 | |
| 125 | l_noret luaD_throw (lua_State *L, TStatus errcode) { |
no outgoing calls
no test coverage detected