Skip to content

gh-121459: Add missing return to _PyDict_LoadGlobalStackRef #124085

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 1 commit into from
Sep 14, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Sep 14, 2024

We need to return immediately if there's an error during dictionary lookup.

Also avoid the conditional-if operator. The Windows 10 buildbot seems to miscompile that for unknown reasons.

We need to return immediately if there's an error during dictionary
lookup.

Also avoid the conditional-if operator. The Windows 10 buildbot seems to
miscompile that for unknown reasons.
@colesbury
Copy link
Contributor Author

!buildbot AMD64 Windows10

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit c8c59a1 🤖

The command will test the builders whose names match following regular expression: AMD64 Windows10

The builders matched are:

  • AMD64 Windows10 PR

Comment on lines +1553 to +1558
if (val == NULL) {
*value_addr = PyStackRef_NULL;
}
else {
*value_addr = PyStackRef_FromPyObjectNew(val);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So... I think MSVC 1916 (Visual Studio 2017) on the Windows 10 buildbot is just really buggy and miscompiles the ternary if...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh, MSVC miscompiles this up through v19.27 (fixed in v19.28):

https://gcc.godbolt.org/z/ezr9rsvM4

@colesbury colesbury merged commit 401fff7 into python:main Sep 14, 2024
42 checks passed
@colesbury colesbury deleted the gh-121459-missing-return branch September 14, 2024 18:29
savannahostrowski pushed a commit to savannahostrowski/cpython that referenced this pull request Sep 22, 2024
…thon#124085)

We need to return immediately if there's an error during dictionary
lookup.

Also avoid the conditional-if operator. MSVC versions through v19.27 miscompile
compound literals with side effects within a conditional operator. This caused
crashes in the Windows10 buildbot.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fiona02 - Please do not post AI-generated PR reviews.

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.

3 participants