arm: Account for Thumb instruction widths in IT lookback - #92
Open
zardus wants to merge 1 commit into
Open
Conversation
Walk each possible IT candidate forward using exact Thumb instruction widths before clearing ITSTATE. Continue past expired candidates so halfwords within 32-bit encodings cannot hide an older active IT.
Member
Author
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Caveat: the executable regressions live in the dependent PyVEX pull request; this repository's local gate is its native build. |
Member
Author
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Full lift-state result for Thumb Before — fixed-width lookback retains a stale ITSTATE guard: VEX baseline 875f7c9After — width-aware lookback proves the instruction unconditional: with this change at 881703e |
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.
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
Lifting Thumb
memchrat0x8002451inlibopencm3_adc-dac-printf.elf, block0x80024e9, can retain ITSTATE after a mixed-width IT group has ended and emit a false conditional exit to0x80024eb.Root cause
The ARM decoder treated every guarded instruction as one halfword during its backward IT search. It could not prove that a mixed-width group had expired, and an expired
0xbf08halfword insideLDREXcould hide an older active IT candidate.Fix
Walk forward from each candidate using the actual 16- or 32-bit Thumb instruction widths. Mark the current instruction conditional only when the candidate reaches it, and continue searching after an expired false candidate.
Testing
The dependent PyVEX regression covers the public
memchrcase, mixed-width expiry, conservative boundary cases, the falseLDREXcandidate, and the lookback-window edge. The native VEX build and the 68-test PyVEX suite passed. Validation: #92 (comment)session: sharpen