Skip to content

Restore hooks after frame setup failures - #354

Merged
akeit0 merged 1 commit into
mainfrom
codex/issue338-all-hook-recovery
Oct 10, 2026
Merged

akeit0 merged 1 commit into
mainfrom
codex/issue338-all-hook-recovery

Conversation

@akeit0

@akeit0 akeit0 commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Line, call, return, and the immediate debug.sethook return callback left hooks suppressed when their frame setup exceeded MaxCallDepth. Protect frame setup with the same cleanup as callback invocation, and pop a hook frame only after a successful push so setup errors preserve the caller and original exception.

Also suppress immediate return-hook dispatch when debug.sethook is called inside a hook. This preserves the documented nonrecursive callback behavior, consistent with Lua 5.2's luaD_hook.

Validation:

  • Expanded hook suite: 45 passing cases; 6 reproduce failures on unchanged main.
  • Full Release tests: 464 runtime and 69 Source Generator cases pass (CI's ExpectedFailure exclusion).
  • Release runtime build: net10.0, net8.0, net6.0, and netstandard2.1; zero warnings/errors.
  • CSharpier: all 249 files pass; git diff --check passes.
  • Internal Unity 6000.5.5f1 project via CLI/Pipeline: 15 bounded hook-recovery/rearming probes pass. Temporary DLL replacements restored and SHA256 verified.

Refs #338. Lightweight delegate/budget API proposals remain deferred; this PR covers hook correctness only.

@akeit0
akeit0 merged commit a2c3934 into main Oct 10, 2026
2 checks passed
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.

1 participant