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"); }