fix debug_info_off linking

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2024-01-27 01:11:32 +01:00
parent 9488208a42
commit 6426ad6dea
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

View file

@ -401,6 +401,7 @@ impl DexWriter {
let mut min_addr = 0;
let mut max_addr = 0;
let mut label_min_max_addrs: HashMap<String, (usize, usize)> = HashMap::new();
for ins in &code.insns {
match ins {
Instruction::Label(Label { name }) => {
@ -2429,7 +2430,7 @@ impl DexWriter {
debug!("Link the debug_info_off entries in code_items");
for code in self.code_items.iter_mut() {
if code.debug_info_off != 0 {
code.debug_info_off += self.section_manager.get_offset(Section::DebugInfoItem);
code.debug_info_off += self.section_manager.get_offset(Section::DebugInfoItem) - 1;
}
}
}