diff options
Diffstat (limited to 'src/nix/repl.cc')
-rw-r--r-- | src/nix/repl.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 9c0d22438..07bf32a0a 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -644,7 +644,8 @@ void NixRepl::addVarToScope(const Symbol & name, Value & v) { if (displ >= envSize) throw Error("environment full; cannot add more variables"); - staticEnv.vars[name] = displ; + staticEnv.vars.emplace_back(name, displ); + staticEnv.sort(); env->values[displ++] = &v; varNames.insert((string) name); } |