Skip to content

Tail chain to the call's return address is a return - #5

Merged
sp00nznet merged 1 commit into
mainfrom
fix/drain-to-return-address
Oct 21, 2026
Merged

sp00nznet merged 1 commit into
mainfrom
fix/drain-to-return-address

Conversation

@sp00nznet

Copy link
Copy Markdown
Owner

Fixes the double-epilogue SP leak in interrupt stubs (3-D Tetris +8/IRQ, StarFox +116/IRQ). Mario's Tennis plays a match, Space Invaders and Wario advance; Mario Clash regresses (documented). Conformance 77/77. Details in RENDER_TRIAGE.md.

🤖 Generated with Claude Code

3-D Tetris's and StarFox's timer stubs jal a handler that ends in a
transfer chain jumping back to the jal's return address. Drained at depth
0 that return was dispatched as an entry and the caller's epilogue ran
twice: SP leaked +8 / +116 per interrupt. VB_CALL/VB_CALLI now remember r31
and the drain stops at it (vb_recomp_drain_to).

Full loop 66/76. Commercial: Mario's Tennis plays a match, Space Invaders
and Wario Land advance; Mario Clash regresses (now reaches interior targets
with no entry). Also Wario Land's greedy-discovery hints (title screen).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sp00nznet
sp00nznet merged commit 57cd4cd into main Oct 21, 2026
1 check passed
@sp00nznet
sp00nznet deleted the fix/drain-to-return-address branch October 21, 2026 19:10
sp00nznet added a commit that referenced this pull request Oct 21, 2026
#5)

3-D Tetris's and StarFox's timer stubs jal a handler that ends in a
transfer chain jumping back to the jal's return address. Drained at depth
0 that return was dispatched as an entry and the caller's epilogue ran
twice: SP leaked +8 / +116 per interrupt. VB_CALL/VB_CALLI now remember r31
and the drain stops at it (vb_recomp_drain_to).

Full loop 66/76. Commercial: Mario's Tennis plays a match, Space Invaders
and Wario Land advance; Mario Clash regresses (now reaches interior targets
with no entry). Also Wario Land's greedy-discovery hints (title screen).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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