Skip to content

Commit a4cc0af

Browse files
committed
gh-151524: Avoid using instrumentation callback result after Py_DECREF
1 parent 8646385 commit a4cc0af

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Python/instrumentation.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,9 @@ call_one_instrument(
989989
if (res == NULL) {
990990
return -1;
991991
}
992+
int is_disable = (res == &_PyInstrumentation_DISABLE);
992993
Py_DECREF(res);
993-
return (res == &_PyInstrumentation_DISABLE);
994+
return is_disable;
994995
}
995996

996997
static const int8_t MOST_SIGNIFICANT_BITS[16] = {

0 commit comments

Comments
 (0)