Skip to content

Conversation

@trumank
Copy link
Contributor

@trumank trumank commented Dec 3, 2025

Currently it's possible to create a LowLevelILFunction with no backing function, but the finalized function does not have an arch associated with it so it's nearly unusable. For example:

let llil = LowLevelILMutableFunction::new(self.arch.clone(), None); // <- no owning function
let (instr_len, _) = self.arch.instruction_llil(&bytes, addr, &llil).unwrap();
let llil = llil.finalized();

let inst = llil.instruction_from_index(LowLevelInstructionIndex(0)).unwrap();
if let SetReg(operation) = inst.kind() {
    if let Reg(operation) = operation.source_expr().kind() {
        operation.source_reg(); // PANICS as unwrap in LowLevelILFunction::arch
    }
}

@emesare
Copy link
Member

emesare commented Dec 3, 2025

Seems reasonable, I will add a unit test for this as well once merged, thank you for the illustrative example!

@emesare emesare self-assigned this Dec 3, 2025
@emesare emesare added the Component: Rust API Issue needs changes to the Rust API label Dec 3, 2025
@emesare emesare added this to the Jotunheim milestone Dec 3, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@emesare emesare merged commit 631f281 into Vector35:dev Dec 4, 2025
0 of 2 checks passed
@trumank trumank deleted the finalized-arch branch December 4, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Rust API Issue needs changes to the Rust API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants