aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index bbba88a3..16eb170d 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1195,9 +1195,15 @@ LUA_API int lua_gc (lua_State *L, int what, ...) {
1195 1195
1196 1196
1197LUA_API int lua_error (lua_State *L) { 1197LUA_API int lua_error (lua_State *L) {
1198 TValue *errobj;
1198 lua_lock(L); 1199 lua_lock(L);
1200 errobj = s2v(L->top - 1);
1199 api_checknelems(L, 1); 1201 api_checknelems(L, 1);
1200 luaG_errormsg(L); 1202 /* error object is the memory error message? */
1203 if (ttisshrstring(errobj) && eqshrstr(tsvalue(errobj), G(L)->memerrmsg))
1204 luaM_error(L); /* raise a memory error */
1205 else
1206 luaG_errormsg(L); /* raise a regular error */
1201 /* code unreachable; will unlock when control actually leaves the kernel */ 1207 /* code unreachable; will unlock when control actually leaves the kernel */
1202 return 0; /* to avoid warnings */ 1208 return 0; /* to avoid warnings */
1203} 1209}