diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-12 15:51:16 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-12 15:51:16 -0300 |
commit | c931d86e98da320c71da70c16d44aa28e9755520 (patch) | |
tree | 2c73ee84120f8f7983d883b3f46546e0676f6ba6 /ldebug.c | |
parent | d9e0f64a5de699a620771af299ea22f522c72f19 (diff) | |
download | lua-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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 | ||