Fix skipping dead DWARF records
This commit is contained in:
committed by
Dan Gohman
parent
19cfec6e8f
commit
d52ab02835
@@ -515,14 +515,14 @@ where
|
|||||||
};
|
};
|
||||||
let mut skip_at_depth = None;
|
let mut skip_at_depth = None;
|
||||||
while let Some((depth_delta, entry)) = entries.next_dfs()? {
|
while let Some((depth_delta, entry)) = entries.next_dfs()? {
|
||||||
let depth_delta = if let Some(depth) = skip_at_depth {
|
let depth_delta = if let Some((depth, cached)) = skip_at_depth {
|
||||||
let new_depth = depth + depth_delta;
|
let new_depth = depth + depth_delta;
|
||||||
if new_depth >= 0 {
|
if new_depth > 0 {
|
||||||
skip_at_depth = Some(new_depth);
|
skip_at_depth = Some((new_depth, cached));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
skip_at_depth = None;
|
skip_at_depth = None;
|
||||||
new_depth
|
new_depth + cached
|
||||||
} else {
|
} else {
|
||||||
depth_delta
|
depth_delta
|
||||||
};
|
};
|
||||||
@@ -530,7 +530,7 @@ where
|
|||||||
let range = get_subprogram_range(entry, addr_tr)?;
|
let range = get_subprogram_range(entry, addr_tr)?;
|
||||||
if range.is_none() {
|
if range.is_none() {
|
||||||
// Subprogram was not compiled: discarding all its info.
|
// Subprogram was not compiled: discarding all its info.
|
||||||
skip_at_depth = Some(0);
|
skip_at_depth = Some((0, depth_delta));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
range
|
range
|
||||||
|
|||||||
Reference in New Issue
Block a user