Skip to content

Commit f8162ae

Browse files
committed
make sure to use ControlFlow result in trace_suspended_continuation
1 parent 476ba8a commit f8162ae

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

crates/wasmtime/src/runtime/vm/traphandlers/backtrace.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ impl Backtrace {
117117
continuation: &VMContRef,
118118
f: impl FnMut(Frame) -> ControlFlow<()>,
119119
) {
120+
log::trace!("====== Capturing Backtrace (suspended continuation) ======");
121+
120122
assert_eq!(
121123
continuation.common_stack_information.state,
122124
VMStackState::Suspended
@@ -137,8 +139,16 @@ impl Backtrace {
137139
// here.
138140
let stack_chain =
139141
VMStackChain::Continuation(continuation as *const VMContRef as *mut VMContRef);
140-
Self::trace_through_continuations(unwind, stack_chain, pc, fp, trampoline_fp, f);
142+
143+
if let ControlFlow::Break(()) =
144+
Self::trace_through_continuations(unwind, stack_chain, pc, fp, trampoline_fp, f)
145+
{
146+
log::trace!("====== Done Capturing Backtrace (closure break) ======");
147+
return;
148+
}
141149
}
150+
151+
log::trace!("====== Done Capturing Backtrace (reached end of stack chain) ======");
142152
}
143153

144154
/// Walk the current Wasm stack, calling `f` for each frame we walk.

0 commit comments

Comments
 (0)