aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-03-12 15:51:16 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-03-12 15:51:16 -0300
commitc931d86e98da320c71da70c16d44aa28e9755520 (patch)
tree2c73ee84120f8f7983d883b3f46546e0676f6ba6 /ldebug.c
parentd9e0f64a5de699a620771af299ea22f522c72f19 (diff)
downloadlua-c931d86e98da320c71da70c16d44aa28e9755520.tar.gz
lua-c931d86e98da320c71da70c16d44aa28e9755520.tar.bz2
lua-c931d86e98da320c71da70c16d44aa28e9755520.zip
'luaD_seterrorobj' should not raise errors
This function can be called unprotected, so it should not raise any kind of errors. (It could raise a memory-allocation error when creating a message).
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ldebug.c b/ldebug.c
index 18bdc595..a3202981 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -832,6 +832,10 @@ l_noret luaG_errormsg (lua_State *L) {
832 L->top.p++; /* assume EXTRA_STACK */ 832 L->top.p++; /* assume EXTRA_STACK */
833 luaD_callnoyield(L, L->top.p - 2, 1); /* call it */ 833 luaD_callnoyield(L, L->top.p - 2, 1); /* call it */
834 } 834 }
835 if (ttisnil(s2v(L->top.p - 1))) { /* error object is nil? */
836 /* change it to a proper message */
837 setsvalue2s(L, L->top.p - 1, luaS_newliteral(L, "<no error object>"));
838 }
835 luaD_throw(L, LUA_ERRRUN); 839 luaD_throw(L, LUA_ERRRUN);
836} 840}
837 841