Skip to content
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

gh-126835: Move optimization of constant sequence creation from codegen to CFG #129426

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Jan 29, 2025

@Eclips4 Eclips4 marked this pull request as draft January 29, 2025 09:22
@Eclips4 Eclips4 marked this pull request as ready for review January 29, 2025 10:45
Python/flowgraph.c Show resolved Hide resolved
Python/flowgraph.c Outdated Show resolved Hide resolved
Python/flowgraph.c Outdated Show resolved Hide resolved
Python/flowgraph.c Outdated Show resolved Hide resolved
Python/flowgraph.c Show resolved Hide resolved
Python/flowgraph.c Outdated Show resolved Hide resolved
@Eclips4 Eclips4 requested a review from iritkatriel January 29, 2025 21:07
Python/flowgraph.c Outdated Show resolved Hide resolved
Python/flowgraph.c Outdated Show resolved Hide resolved
Python/flowgraph.c Outdated Show resolved Hide resolved
Python/flowgraph.c Outdated Show resolved Hide resolved
@@ -1751,6 +1820,14 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
}
}
break;
case BUILD_LIST:
case BUILD_SET:
if (i >= oparg) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it not a compiler bug if i < oparg?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's not. But if you're asking about removing this condition, I tried it and there was something completely wrong. The address sanitizer reported a heap-buffer-overflow error in that case. You can see this in this PR, before the ea07a50

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