fix curr_mod not refreshed on in-hook run transitions#316
Merged
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
williballenthin
force-pushed
the
worktree-fix-306-curr-mod-refresh
branch
from
July 24, 2026 10:29
37b148d to
1c6bca1
Compare
…s against the correct module Previously curr_mod was only refreshed inside the _execute_runs loop, so in-hook run transitions via _exec_next_run kept a stale curr_mod from the previous run. This caused handle_import_func to consult the wrong module's import table when control transferred to a different module. Closes #306
williballenthin
force-pushed
the
worktree-fix-306-curr-mod-refresh
branch
from
July 24, 2026 10:30
1c6bca1 to
5c3c928
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
curr_modfromrun.start_addrin_prepare_run_contextso every run — whether entered viastart()or_exec_next_run()— has the correct current module before any hooks fire.curr_modassignment at the top of_execute_runs's while loop, since_prepare_run_contextalways runs first.Previously,
curr_modwas only set inside the_execute_runsloop. In-hook run transitions via_exec_next_run→_prepare_run_contextnever refreshed it, sohandle_import_funccould consult the wrong module's import table when control transferred to a different module.Closes #306
🤖 Generated with Claude Code