Skip to content

Commit 52bed26

Browse files
authored
gh-151524: Make it clearer that _PyInstrumentation_DISABLE is immortal in the code (GH-151525)
1 parent 82905dd commit 52bed26

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Python/instrumentation.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,12 @@ call_one_instrument(
989989
if (res == NULL) {
990990
return -1;
991991
}
992+
if (res == &_PyInstrumentation_DISABLE) {
993+
assert(_Py_IsImmortal(res));
994+
return 1;
995+
}
992996
Py_DECREF(res);
993-
return (res == &_PyInstrumentation_DISABLE);
997+
return 0;
994998
}
995999

9961000
static const int8_t MOST_SIGNIFICANT_BITS[16] = {

0 commit comments

Comments
 (0)