Skip to content

Commit 128a3ec

Browse files
committed
Refresh profiling state after eval-breaker callbacks
Reload the cached tracing flag only when eval-breaker work actually runs, preserving the untripped hot path. Signal handlers and scheduled GC callbacks can enable or disable profiling before the current instruction dispatch. Assisted-by: Codex:unknown
1 parent 4347987 commit 128a3ec

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎crates/vm/src/frame.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3921,7 +3921,13 @@ impl ExecutingFrame<'_> {
39213921
vm.raise_async_exception()
39223922
}
39233923
if vm.eval_breaker_tripped()
3924-
&& let Err(exception) = eval_breaker_work(vm)
3924+
&& let Err(exception) = {
3925+
let result = eval_breaker_work(vm);
3926+
// Signal handlers and scheduled GC callbacks may change
3927+
// profiling before this instruction is dispatched.
3928+
tracing = !PREPARE_GENERATOR && vm.use_tracing.get();
3929+
result
3930+
}
39253931
{
39263932
#[cold]
39273933
fn handle_signal_exception(

0 commit comments

Comments
 (0)