From 6142fbb1c6aaa18411909009b457252f14ea6759 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Fri, 13 May 2016 15:37:49 -0700 Subject: [PATCH] feat(library/vm/vm): check interruptions and memory at invocation --- src/library/vm/vm.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/library/vm/vm.cpp b/src/library/vm/vm.cpp index d7bd02655f..d4881f34e4 100644 --- a/src/library/vm/vm.cpp +++ b/src/library/vm/vm.cpp @@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #include +#include "util/interrupt.h" #include "util/sstream.h" #include "util/parray.h" #include "util/small_object_allocator.h" @@ -929,6 +930,8 @@ void vm_state::run() { } } case opcode::InvokeGlobal: + check_interrupted(); + check_memory("vm"); /** Instruction: ginvoke fn @@ -951,6 +954,8 @@ void vm_state::run() { invoke_global(m_decls[instr.get_fn_idx()]); goto main_loop; case opcode::InvokeBuiltin: + check_interrupted(); + check_memory("vm"); /** Instruction: builtin fn