diff options
author | 2011-04-19 16:47:51 +0200 | |
---|---|---|
committer | 2011-04-19 16:47:51 +0200 | |
commit | aa33547c764a229e22d323ca213d46ea221b903e (patch) | |
tree | 3894cb190f34bc1d2deee4322a674db641562ee0 /kernel/byterun/coq_interp.c | |
parent | 50dc9067e98ca001ad2e875011abab5da6fdb621 (diff) | |
parent | 9d27ae09786866b6e3d7b79d1fa7667e5e2aa309 (diff) |
Remove non-DFSG contentsupstream/8.3.pl2+dfsg
Diffstat (limited to 'kernel/byterun/coq_interp.c')
-rw-r--r-- | kernel/byterun/coq_interp.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c index 98ef2791..cce2319b 100644 --- a/kernel/byterun/coq_interp.c +++ b/kernel/byterun/coq_interp.c @@ -14,6 +14,7 @@ for fast computation of bounded (31bits) integers */ #include <stdio.h> +#include <signal.h> #include "coq_gc.h" #include "coq_instruct.h" #include "coq_fix_code.h" @@ -157,6 +158,12 @@ sp is a local copy of the global variable extern_sp. */ #endif #endif +/* For signal handling, we highjack some code from the caml runtime */ + +extern intnat caml_signals_are_pending; +extern intnat caml_pending_signals[]; +extern void caml_process_pending_signals(void); + /* The interpreter itself */ value coq_interprete @@ -414,8 +421,13 @@ value coq_interprete realloc_coq_stack(Coq_stack_threshold); sp = coq_sp; } + /* We also check for signals */ + if (caml_signals_are_pending) { + /* If there's a Ctrl-C, we reset the vm */ + if (caml_pending_signals[SIGINT]) { coq_sp = coq_stack_high; } + caml_process_pending_signals(); + } Next; - /* Fall through CHECK_SIGNALS */ Instruct(APPTERM) { int nargs = *pc++; |