mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
GH-125174: Make immortal objects more robust, following design from PEP 683 (GH-125251)
This commit is contained in:
parent
01fc3b34cc
commit
c9014374c5
17 changed files with 61 additions and 72 deletions
|
@ -381,7 +381,7 @@ dummy_func(
|
|||
EXIT_IF(!PyLong_CheckExact(value_o));
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (_PyLong_IsZero((PyLongObject *)value_o)) {
|
||||
assert(_Py_IsImmortalLoose(value_o));
|
||||
assert(_Py_IsImmortal(value_o));
|
||||
DEAD(value);
|
||||
res = PyStackRef_False;
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ dummy_func(
|
|||
EXIT_IF(!PyUnicode_CheckExact(value_o));
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (value_o == &_Py_STR(empty)) {
|
||||
assert(_Py_IsImmortalLoose(value_o));
|
||||
assert(_Py_IsImmortal(value_o));
|
||||
DEAD(value);
|
||||
res = PyStackRef_False;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue