Skip to content

gh-148083: Prevent constant folding when lhs is container types#148090

Merged
corona10 merged 2 commits intopython:mainfrom
corona10:gh-148083-fix
Apr 4, 2026
Merged

gh-148083: Prevent constant folding when lhs is container types#148090
corona10 merged 2 commits intopython:mainfrom
corona10:gh-148083-fix

Conversation

@corona10
Copy link
Copy Markdown
Member

@corona10 corona10 commented Apr 4, 2026

}

bool
_Py_uop_sym_is_container(JitOptRef sym)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to make this an allowlist, so we should say sym_is_not_container and check for the usual int float str etc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise custom containers might be let through

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@corona10 corona10 merged commit 853dafe into python:main Apr 4, 2026
72 of 73 checks passed
@corona10 corona10 deleted the gh-148083-fix branch April 4, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants