This commit is contained in:
Jean-Marie Mineau 2024-01-04 10:38:07 +01:00
parent b17a84212f
commit d470881d98
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

View file

@ -121,20 +121,19 @@ impl CodeItem {
i += 1;
}
for insn in &self.insns {
addr += insn.size() as u32;
addr += insn.size() as u32 / 2;
while i < addresses.len() && addresses[i] == addr {
i += 1;
}
}
if i < addresses.len() && addresses[i] < addr {
println!("{addresses:x?}");
return Err(Error::InconsistantStruct(format!(
"Found an address in try block (0x{:x}) that does not align with an instruction",
addresses[i]
)));
}
// TODO check goto addresses? pb: op code are not parsed so goto instruction are not known
// TODO check goto and if addresses? pb: op code are not parsed so goto instruction are not known
Ok(())
}