Skip to content

Commit

Permalink
Change union offset validation
Browse files Browse the repository at this point in the history
  • Loading branch information
DaZombieKiller committed Jan 10, 2024
1 parent c7fb8c7 commit 046ea15
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/util/dwarf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 046ea15

Please sign in to comment.