Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-131798: Remove guard for known type in TO_BOOL_STR #131816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Style fixes in TO_BOOL_STR
  • Loading branch information
fluhus committed Mar 28, 2025
commit 7487669954b9b5482c4b0ec2c9b850bd6e7dc5b0
8 changes: 4 additions & 4 deletions 8 Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,14 @@ dummy_func(
res = PyStackRef_False;
}

op(_GUARD_TOS_UNICODE, (value-- value)) {
op(_GUARD_TOS_UNICODE, (value -- value)) {
PyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
EXIT_IF(!PyUnicode_CheckExact(value_o));
}

op(_TO_BOOL_STR, (value-- res)) {
op(_TO_BOOL_STR, (value -- res)) {
STAT_INC(TO_BOOL, hit);
PyObject* value_o = PyStackRef_AsPyObjectBorrow(value);
PyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
if (value_o == &_Py_STR(empty)) {
assert(_Py_IsImmortal(value_o));
DEAD(value);
Expand All @@ -533,7 +533,7 @@ dummy_func(
}

macro(TO_BOOL_STR) =
_GUARD_TOS_UNICODE + unused / 1 + unused / 2 + _TO_BOOL_STR;
_GUARD_TOS_UNICODE + unused/1 + unused/2 + _TO_BOOL_STR;

op(_REPLACE_WITH_TRUE, (value -- res)) {
PyStackRef_CLOSE(value);
Expand Down
2 changes: 1 addition & 1 deletion 2 Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2 Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.