diff options
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/nixexpr.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index edab297f2..b34112be1 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -470,9 +470,6 @@ void ExprCall::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> & void ExprLet::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> & env) { - if (es.debugRepl) - es.exprEnvs.insert(std::make_pair(this, env)); - auto newEnv = std::make_shared<StaticEnv>(nullptr, env.get(), attrs->attrs.size()); Displacement displ = 0; @@ -484,6 +481,9 @@ void ExprLet::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> & for (auto & i : attrs->attrs) i.second.e->bindVars(es, i.second.inherited ? env : newEnv); + if (es.debugRepl) + es.exprEnvs.insert(std::make_pair(this, newEnv)); + body->bindVars(es, newEnv); } @@ -508,9 +508,6 @@ void ExprWith::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> & break; } - if (es.debugRepl) - es.exprEnvs.insert(std::make_pair(this, env)); - attrs->bindVars(es, env); auto newEnv = std::make_shared<StaticEnv>(this, env.get()); body->bindVars(es, newEnv); |