Skip to content

Fix IL lookups that used the wrong kind of index - #8698

Open
bdash wants to merge 3 commits into
devfrom
test_il_index_confusion
Open

bdash wants to merge 3 commits into
devfrom
test_il_index_confusion

Conversation

@bdash

@bdash bdash commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Several APIs passed an index to the wrong type of IL function, or passed an expression index where core expects an instruction index, or the reverse. The lookups silently returned unrelated expressions as the indexes are not strongly typed.

This PR fixes the Rust MLIL/HLIL bindings, MediumLevelILInstruction::GetLowLevelIL, and one lookup in efi_resolver. In Rust, ILReferenceSource::expr_idx is now instr_idx, because it is an instruction index rather than an expression index.

bdash added 3 commits October 28, 2026 18:40
Several MLIL and HLIL wrappers passed or interpreted the wrong kind of
index, so they silently returned results for unrelated expressions.
`ILReferenceSource::expr_idx` is now `instr_idx`, since core stores an
instruction index there.
…pression

Core maps MLIL expressions to LLIL SSA expressions, but this looked
them up in non-SSA LLIL.
It asked non-SSA HLIL for the definition, but used the returned index
to fetch an expression from SSA HLIL.
@bdash
bdash requested a review from emesare October 29, 2026 01:47

This branch has not been deployed

No deployments
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