From a9c33cbfd7419a942d928c03a0d7e46160bc2703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Wed, 26 Aug 2015 20:15:42 +0200 Subject: [PATCH] VM: better way to set signal_resumable --- vm/cpu-x86.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/vm/cpu-x86.cpp b/vm/cpu-x86.cpp index 6573f0d7aa..494ce6fa8f 100644 --- a/vm/cpu-x86.cpp +++ b/vm/cpu-x86.cpp @@ -10,8 +10,6 @@ void factor_vm::dispatch_non_resumable_signal(cell* sp, cell* pc, call stack from *sp and instead use the last saved "good value" which we get from ctx->callstack_top. Then launch the handler without going through the resumable subprimitive. */ - signal_resumable = false; - cell frame_top = ctx->callstack_top; cell seg_start = ctx->callstack_seg->start; @@ -40,8 +38,6 @@ void factor_vm::dispatch_non_resumable_signal(cell* sp, cell* pc, void factor_vm::dispatch_resumable_signal(cell* sp, cell* pc, cell handler) { - signal_resumable = true; - /* Fault came from Factor, and we've got a good callstack. Route the signal handler through the resumable signal handler subprimitive. */ @@ -81,8 +77,9 @@ void factor_vm::dispatch_signal_handler(cell* sp, cell* pc, cell handler) { bool in_code_seg = code->seg->in_segment_p(*pc); cell cs_limit = ctx->callstack_seg->start + stack_reserved; - bool resumable_p = in_code_seg && *sp >= cs_limit; - if (resumable_p) { + signal_resumable = in_code_seg && *sp >= cs_limit; + + if (signal_resumable) { dispatch_resumable_signal(sp, pc, handler); } else { dispatch_non_resumable_signal(sp, pc, handler, cs_limit);