mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-123091: Use _Py_IsImmortalLoose() (#123511)
Use _Py_IsImmortalLoose() in bytesobject.c, typeobject.c
and ceval.c.
(cherry picked from commit f1a0d96f41
)
This commit is contained in:
parent
b76a4a5db7
commit
10735bff9e
7 changed files with 17 additions and 17 deletions
|
@ -362,7 +362,7 @@ dummy_func(
|
|||
EXIT_IF(!PyLong_CheckExact(value));
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (_PyLong_IsZero((PyLongObject *)value)) {
|
||||
assert(_Py_IsImmortal(value));
|
||||
assert(_Py_IsImmortalLoose(value));
|
||||
res = Py_False;
|
||||
}
|
||||
else {
|
||||
|
@ -389,7 +389,7 @@ dummy_func(
|
|||
EXIT_IF(!PyUnicode_CheckExact(value));
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (value == &_Py_STR(empty)) {
|
||||
assert(_Py_IsImmortal(value));
|
||||
assert(_Py_IsImmortalLoose(value));
|
||||
res = Py_False;
|
||||
}
|
||||
else {
|
||||
|
|
4
Python/executor_cases.c.h
generated
4
Python/executor_cases.c.h
generated
|
@ -347,7 +347,7 @@
|
|||
}
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (_PyLong_IsZero((PyLongObject *)value)) {
|
||||
assert(_Py_IsImmortal(value));
|
||||
assert(_Py_IsImmortalLoose(value));
|
||||
res = Py_False;
|
||||
}
|
||||
else {
|
||||
|
@ -398,7 +398,7 @@
|
|||
}
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (value == &_Py_STR(empty)) {
|
||||
assert(_Py_IsImmortal(value));
|
||||
assert(_Py_IsImmortalLoose(value));
|
||||
res = Py_False;
|
||||
}
|
||||
else {
|
||||
|
|
4
Python/generated_cases.c.h
generated
4
Python/generated_cases.c.h
generated
|
@ -5939,7 +5939,7 @@
|
|||
DEOPT_IF(!PyLong_CheckExact(value), TO_BOOL);
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (_PyLong_IsZero((PyLongObject *)value)) {
|
||||
assert(_Py_IsImmortal(value));
|
||||
assert(_Py_IsImmortalLoose(value));
|
||||
res = Py_False;
|
||||
}
|
||||
else {
|
||||
|
@ -5999,7 +5999,7 @@
|
|||
DEOPT_IF(!PyUnicode_CheckExact(value), TO_BOOL);
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
if (value == &_Py_STR(empty)) {
|
||||
assert(_Py_IsImmortal(value));
|
||||
assert(_Py_IsImmortalLoose(value));
|
||||
res = Py_False;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue