Skip to content

gh-143820: Fix assertion failure that occurred when inserting ENTER_EXECUTOR after BINARY_OP_INPLACE_ADD_UNICODE#146324

Open
cocolato wants to merge 2 commits intopython:mainfrom
cocolato:gh-143820
Open

gh-143820: Fix assertion failure that occurred when inserting ENTER_EXECUTOR after BINARY_OP_INPLACE_ADD_UNICODE#146324
cocolato wants to merge 2 commits intopython:mainfrom
cocolato:gh-143820

Conversation

@cocolato
Copy link
Contributor

@cocolato cocolato commented Mar 23, 2026

This PR calculate the target STORE_FAST local variable index during the Specialization phase and store it in the instruction's own inline cache.

So that:

  1. The instruction becomes entirely self-contained at runtime. It no longer cares if the JIT subsequently overwrites the next instruction with ENTER_EXECUTOR.
  2. It correctly handles cases where the STORE_FAST has an index > 255 (which uses EXTENDED_ARG prefixes).

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

Wow, this is incredibly smart! I like this solution! Thanks!

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