Skip to content

Commit 265f2bb

Browse files
authored
MSVC: Ignore unwinds and catches when inferring function sizes (#391)
* Xbox 360 PPC: Ignore unwinds and catches when inferring function sizes * Don't check unwinds/catches when inferring object sizes, only functions
1 parent a6a9b6f commit 265f2bb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

objdiff-core/src/obj/read.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ fn infer_symbol_sizes(arch: &dyn Arch, symbols: &mut [Symbol], sections: &[Secti
334334
break None;
335335
}
336336
if match symbol.kind {
337+
SymbolKind::Function
338+
if next_symbol.kind == SymbolKind::Function
339+
&& (next_symbol.name.starts_with("__unwind$")
340+
|| next_symbol.name.starts_with("__catch$")) =>
341+
{
342+
// MSVC unwinds/catches count as functions, but shouldn't cut off the function they're from.
343+
false
344+
}
337345
SymbolKind::Function | SymbolKind::Object => {
338346
// For function/object symbols, find the next function/object
339347
matches!(next_symbol.kind, SymbolKind::Function | SymbolKind::Object)

0 commit comments

Comments
 (0)