Skip to content

gh-158401: Mask out the deferred bit in PyStackRef_Is[True,False,None] - #162275

Open
encukou wants to merge 1 commit into
python:mainfrom
encukou:deimmortalization-sr-mask
Open

encukou wants to merge 1 commit into
python:mainfrom
encukou:deimmortalization-sr-mask

Conversation

@encukou

@encukou encukou commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

This should fix the PyStackRef_Is* checks for de-immortalized constants.

With this, the reproducer in gh-158401 fails in debug builds with _Py_INCREF_MORTAL: Assertion !_Py_IsStaticImmortal(op)' failed.` There's a lot of asserts like that -- and maybe it's better if debug builds fail with long-running pre-3.11 extensions than if we remove these asserts.

I checked other immortality checks, but didn't notice one that fails to degrade gracefully. [edit: see below]
I hope to get to a more in-depth check later.

@encukou

encukou commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Hm, I did found other code that relies on immortality. I'll pick this up again next week.

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.

1 participant