Skip to content

gh-154037: Fix race in the Decimal.__hash__()#154045

Open
skirpichev wants to merge 3 commits into
python:mainfrom
skirpichev:fix-race-in-Decimal-hash/154037
Open

gh-154037: Fix race in the Decimal.__hash__()#154045
skirpichev wants to merge 3 commits into
python:mainfrom
skirpichev:fix-race-in-Decimal-hash/154037

Conversation

@skirpichev

@skirpichev skirpichev commented Jul 19, 2026

Copy link
Copy Markdown
Member

@skirpichev

Copy link
Copy Markdown
Member Author

I think it's safe enough to backport. Though, I doubt it worth: this patch just prevents hash recomputing in some cases.

@encukou

encukou commented Jul 19, 2026

Copy link
Copy Markdown
Member

Does the compiler always optimize the duplicate ATOMIC_LOAD?

@skirpichev

Copy link
Copy Markdown
Member Author

Does the compiler always optimize the duplicate ATOMIC_LOAD?

Well, maybe some not. Lets use a local variable, anyway.

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