Skip to content

Commit fbf904b

Browse files
committed
TASK-194243 tune logging
1 parent 1aa55d7 commit fbf904b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/lapi.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)