aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index ba9fe9c65..e15781404 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -3,6 +3,7 @@
#include "hash.hh"
#include "primops.hh"
#include "print-options.hh"
+#include "shared.hh"
#include "types.hh"
#include "util.hh"
#include "store-api.hh"
@@ -391,7 +392,6 @@ EvalState::EvalState(
, buildStore(buildStore ? buildStore : store)
, debugRepl(nullptr)
, debugStop(false)
- , debugQuit(false)
, trylevel(0)
, regexCache(makeRegexCache())
#if HAVE_BOEHMGC
@@ -798,7 +798,17 @@ void EvalState::runDebugRepl(const Error * error, const Env & env, const Expr &
auto se = getStaticEnv(expr);
if (se) {
auto vm = mapStaticEnvBindings(symbols, *se.get(), env);
- (debugRepl)(ref<EvalState>(shared_from_this()), *vm);
+ auto exitStatus = (debugRepl)(ref<EvalState>(shared_from_this()), *vm);
+ switch (exitStatus) {
+ case ReplExitStatus::QuitAll:
+ if (error)
+ throw *error;
+ throw Exit(0);
+ case ReplExitStatus::Continue:
+ break;
+ default:
+ abort();
+ }
}
}