From 8dd64598ed52889134c0974c4f5e92641ddc0b46 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sat, 25 Oct 2025 10:03:57 -0400 Subject: [PATCH] Fix inline stacks --- src/profiler/state.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/profiler/state.rs b/src/profiler/state.rs index f305bbc..74b6130 100644 --- a/src/profiler/state.rs +++ b/src/profiler/state.rs @@ -60,6 +60,11 @@ impl ProgramState { let Some(stack) = self.call_stacks.get_mut(code) else { bail!("missing stack {code:04x}"); }; + // just popping the inline frames first + while stack + .pop_if(|f| matches!(f, StackFrame::Label(_))) + .is_some() + {} if stack.pop().is_none() { bail!("returned from {code:04x} but stack was empty"); }