Skip to content

fix curr_mod not refreshed on in-hook run transitions#316

Merged
williballenthin merged 1 commit into
masterfrom
worktree-fix-306-curr-mod-refresh
Jul 24, 2026
Merged

fix curr_mod not refreshed on in-hook run transitions#316
williballenthin merged 1 commit into
masterfrom
worktree-fix-306-curr-mod-refresh

Conversation

@williballenthin

Copy link
Copy Markdown
Collaborator

Summary

  • Refresh curr_mod from run.start_addr in _prepare_run_context so every run — whether entered via start() or _exec_next_run() — has the correct current module before any hooks fire.
  • Remove the now-redundant curr_mod assignment at the top of _execute_runs's while loop, since _prepare_run_context always runs first.

Previously, curr_mod was only set inside the _execute_runs loop. In-hook run transitions via _exec_next_run_prepare_run_context never refreshed it, so handle_import_func could consult the wrong module's import table when control transferred to a different module.

Closes #306

🤖 Generated with Claude Code

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@google-cla

google-cla Bot commented Jul 24, 2026

Copy link
Copy Markdown

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
williballenthin force-pushed the worktree-fix-306-curr-mod-refresh branch from 37b148d to 1c6bca1 Compare July 24, 2026 10:29
…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
williballenthin force-pushed the worktree-fix-306-curr-mod-refresh branch from 1c6bca1 to 5c3c928 Compare July 24, 2026 10:30
@williballenthin
williballenthin merged commit e2134f1 into master Jul 24, 2026
10 checks passed
@williballenthin
williballenthin deleted the worktree-fix-306-curr-mod-refresh branch July 24, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

curr_mod not refreshed on in-hook run transitions (stale module for import resolution)

1 participant