mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +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
4
Python/generated_cases.c.h
generated
4
Python/generated_cases.c.h
generated
|
@ -7840,7 +7840,7 @@
|
|||
DEOPT_IF(!PyLong_CheckExact(value_o), TO_BOOL);
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (_PyLong_IsZero((PyLongObject *)value_o)) {
|
||||
assert(_Py_IsImmortalLoose(value_o));
|
||||
assert(_Py_IsImmortal(value_o));
|
||||
res = PyStackRef_False;
|
||||
}
|
||||
else {
|
||||
|
@ -7902,7 +7902,7 @@
|
|||
DEOPT_IF(!PyUnicode_CheckExact(value_o), TO_BOOL);
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (value_o == &_Py_STR(empty)) {
|
||||
assert(_Py_IsImmortalLoose(value_o));
|
||||
assert(_Py_IsImmortal(value_o));
|
||||
res = PyStackRef_False;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue