From 5f5cfabb89637375ace183d01d602fde13b855ed Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 19 Nov 2021 20:35:02 +1100 Subject: [PATCH] Fix bug in stack frame trimming. If inlining happened in a certain way, too much could be trimmed from the bottom of the stack trace, because we would only include the first entry with the last kept address, rather than all entries with that last kept address. --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8b7d1b5..c683e83 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -808,10 +808,10 @@ fn finish(dhat: &mut Dhat) -> Option { next_ftbl_idx - 1 }); fs.push(ftbl_idx); + } - if Some(frame.ip()) == last_frame_ip_to_show { - break 'outer; - } + if Some(frame.ip()) == last_frame_ip_to_show { + break 'outer; } }