Skip to content

Preserve instructions during FB static access conversion - #264

Merged
jogibear9988 merged 1 commit into
masterfrom
codex/fix-247-static-access-instructions
Oct 21, 2026
Merged

jogibear9988 merged 1 commit into
masterfrom
codex/fix-247-static-access-instructions

Conversation

@jogibear9988

Copy link
Copy Markdown
Member

Fixes #247.

ReplaceStaticAccess could drop every LAR2, the indirect DI access after TAR2/+AR2, and buffered instructions at the end of a block. Replace operands in place so every original instruction remains in order. Keep the existing ordinary symbolic replacement and MC7 bytes, and leave unsupported offset-based accesses unchanged. Remove the unused offset calculation, which could also throw for operandless +AR2.

Validation: added 10 regression cases covering instruction preservation, ordinary symbolic replacement and MC7 preservation, disabled conversion, and non-FB blocks. The full unit test suite passes on the latest master: 61 passed, 0 failed (dotnet test ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj).

@jogibear9988

Copy link
Copy Markdown
Member Author

@TomMuehlegger
What do you think, not that this break smth on your side....

@TomMuehlegger

Copy link
Copy Markdown
Contributor

@jogibear9988 the changes are looking good. I did a review and the behaviour should more or less stay the same. Good from our end.

@jogibear9988
jogibear9988 merged commit 77999b3 into master Oct 21, 2026
2 checks passed
@jogibear9988
jogibear9988 deleted the codex/fix-247-static-access-instructions branch October 21, 2026 17:37
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.

Dropped instructions from FBStaticAccessConverter

2 participants