1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

shared_ptr for StaticEnv

This commit is contained in:
Ben Burdette 2021-09-14 10:49:22 -06:00
parent 176911102c
commit 21071bfdeb
8 changed files with 57 additions and 69 deletions

View file

@ -186,11 +186,11 @@ static void import(EvalState & state, const Pos & pos, Value & vPath, Value * vS
Env * env = &state.allocEnv(vScope->attrs->size());
env->up = &state.baseEnv;
StaticEnv staticEnv(false, &state.staticBaseEnv);
auto staticEnv = std::shared_ptr<StaticEnv>(new StaticEnv(false, state.staticBaseEnv.get()));
unsigned int displ = 0;
for (auto & attr : *vScope->attrs) {
staticEnv.vars[attr.name] = displ;
staticEnv->vars[attr.name] = displ;
env->values[displ++] = attr.value;
}