Repository navigation
fix: avoid broad fallback for unresolved JALR calls - #436
Open
Tzeentchnet wants to merge 2 commits into
Open
Tzeentchnet wants to merge 2 commits into
Tzeentchnet wants to merge 2 commits into
Conversation
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
JALR $zeroindirect jumps.Rationale
A JALR with a nonzero link destination is emitted as an indirect call through the runtime dispatcher, and execution resumes in the caller at
pc + 8. The analyzer already records that return PC, but then falls through to unresolved-jump handling and marks every instruction in the caller as a possible indirect jump target. This creates unnecessary entry points and labels for indirect calls.Returning immediately after recording the call's resume address keeps call and jump semantics separate.
JALR $zero, $rsdoes not produce a return link and remains on the existing unresolved indirect-jump fallback path, as does JR.Testing
Updated focused control-flow coverage to verify that:
pc + 8a resume entry and emitted caller label;JALR $zerodoes not add a return entry and retains broad indirect fallback;The existing unresolved-JR fallback test continues to pass.
Windows Release builds:
ps2x_tests— 447 passed, 0 failed.ps2x_tests— 447 passed, 0 failed.