File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1233,8 +1233,13 @@ LUA_API int lua_error (lua_State *L) {
12331233 lua_lock (L );
12341234 LUAI_TRY_BLOCK (L ) {
12351235 api_checknelems (L , 1 );
1236- if (!L -> errorJmp ) {
1237- /* Use raw accessors (ttisstring/svalue) instead of the public API
1236+ if (!lj .previous ) {
1237+ /* Log only when there is no outer error handler -- i.e. the error
1238+ * will ultimately reach the panic branch. We check lj.previous
1239+ * (not L->errorJmp) because LUAI_TRY_BLOCK already set
1240+ * L->errorJmp = &lj, so L->errorJmp is always non-NULL here.
1241+ *
1242+ * Use raw accessors (ttisstring/svalue) instead of the public API
12381243 * (lua_isstring/lua_tostring). lua_isstring returns true for
12391244 * numbers, and lua_tostring -> lua_tolstring calls lua_lock for
12401245 * number-to-string conversion, which would deadlock since we
You can’t perform that action at this time.
0 commit comments