Change union offset validation

This commit is contained in:
Benjamin Moir 2024-01-10 18:11:14 +10:00
parent c7fb8c79fc
commit 046ea15f36
1 changed files with 1 additions and 3 deletions

View File

@ -1472,9 +1472,7 @@ fn get_anon_unions(info: &DwarfInfo, members: &[StructureMember]) -> Result<Vec<
continue;
}
}
let size =
if let Some(size) = member.byte_size { size } else { member.kind.size(info)? };
if member.offset + size > max_offset || member.offset < anon.offset {
if member.offset >= max_offset || member.offset < anon.offset {
break;
}
anon.member_count += 1;