Skip to content

gh-149459: Fix segfault when _LOAD_SPECIAL guard deoptimizes#149478

Open
cocolato wants to merge 4 commits intopython:mainfrom
cocolato:gh-149459
Open

gh-149459: Fix segfault when _LOAD_SPECIAL guard deoptimizes#149478
cocolato wants to merge 4 commits intopython:mainfrom
cocolato:gh-149459

Conversation

@cocolato
Copy link
Copy Markdown
Member

@cocolato cocolato commented May 7, 2026

LOAD_SPECIAL expands as:
_RECORD_TOS_TYPE + _INSERT_NULL + _LOAD_SPECIAL
_INSERT_NULL alters the actual stack structure:
Before modification: [..., self]
After modification: [..., NULL, self]
The optimizer has introduced _GUARD_TYPE_VERSION. If a guard is placed after _INSERT_NULL, and the guard fails resulting in a side exit, the interpreter will deopt back to the original LOAD_SPECIAL. However, by this point, the stack has already been modified by _INSERT_NULL to [..., NULL, self].

@read-the-docs-community
Copy link
Copy Markdown

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