diff --git a/src/kernel/for_each_fn.cpp b/src/kernel/for_each_fn.cpp index a858d2d9f..470ecf98b 100644 --- a/src/kernel/for_each_fn.cpp +++ b/src/kernel/for_each_fn.cpp @@ -7,6 +7,8 @@ Author: Leonardo de Moura #include #include #include "util/flet.h" +#include "util/memory.h" +#include "util/interrupt.h" #include "kernel/for_each_fn.h" #include "kernel/cache_stack.h" @@ -59,6 +61,8 @@ class for_each_fn { begin_loop: if (todo.empty()) break; + check_interrupted(); + check_memory("expression traversal"); auto p = todo.back(); todo.pop_back(); expr const & e = p.first; diff --git a/src/kernel/replace_fn.cpp b/src/kernel/replace_fn.cpp index e424941b0..060046834 100644 --- a/src/kernel/replace_fn.cpp +++ b/src/kernel/replace_fn.cpp @@ -151,6 +151,7 @@ public: while (!m_fs.empty()) { begin_loop: check_interrupted(); + check_memory("replace"); frame & f = m_fs.back(); expr const & e = f.m_expr; unsigned offset = f.m_offset; @@ -218,6 +219,8 @@ class replace_rec_fn { return *r; shared = true; } + check_interrupted(); + check_memory("replace"); if (optional r = m_f(e, offset)) { return save_result(e, offset, *r, shared);