Skip to content

Vary compiler flags in fuzz_pycompile#145236

Merged
alex merged 2 commits intopython:mainfrom
StanFromIreland:pycompile_fuzzer_flags
Mar 9, 2026
Merged

Vary compiler flags in fuzz_pycompile#145236
alex merged 2 commits intopython:mainfrom
StanFromIreland:pycompile_fuzzer_flags

Conversation

@StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Feb 25, 2026

Implements an old todo suggestion.

// Use third byte to determine compiler flags to use.
unsigned char flags_byte = (unsigned char) data[2];
PyCompilerFlags flags = _PyCompilerFlags_INIT;
if (flags_byte & 0x01) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure all of these are useful/make sense.

I don't think PyCF_SOURCE_IS_UTF8 does anything, for example. So I'd drop that and PyCF_ONLY_AST,

Copy link
Member Author

Choose a reason for hiding this comment

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

I can drop PyCF_SOURCE_IS_UTF8, but PyCF_ONLY_AST does change quite a lot.

@StanFromIreland StanFromIreland requested a review from alex March 9, 2026 22:25
@alex alex enabled auto-merge (squash) March 9, 2026 22:27
@StanFromIreland
Copy link
Member Author

Thanks for the review ❤️

@alex
Copy link
Member

alex commented Mar 9, 2026

Thanks for working on this!

@alex alex merged commit 099943b into python:main Mar 9, 2026
49 checks passed
@StanFromIreland StanFromIreland deleted the pycompile_fuzzer_flags branch March 9, 2026 22:55
@StanFromIreland
Copy link
Member Author

This already found its first bug in the parser! Not even a day after its implementation: #145783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants