diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-08-30 12:23:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 12:23:09 +0200 |
commit | 323cafcb4ec632881c297f9b3004ea7fb07b678f (patch) | |
tree | a83b133815dfa21a7489aa0d1d02ce31e17adca5 /src/libexpr/primops.cc | |
parent | 00f9957552180ef44fe5fab98f7d09cd15d99506 (diff) | |
parent | 8656b130ea6defe6a7ef04b564ff391caa64a450 (diff) |
Merge pull request #5191 from hercules-ci/evalstate-lifetime-hygiene
EvalState lifetime hygiene
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 2295e69a1..25d60e175 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -160,16 +160,15 @@ static void import(EvalState & state, const Pos & pos, Value & vPath, Value * vS } w.attrs->sort(); - static RootValue fun; - if (!fun) { - fun = allocRootValue(state.allocValue()); + if (!state.vImportedDrvToDerivation) { + state.vImportedDrvToDerivation = allocRootValue(state.allocValue()); state.eval(state.parseExprFromString( #include "imported-drv-to-derivation.nix.gen.hh" - , "/"), **fun); + , "/"), **state.vImportedDrvToDerivation); } - state.forceFunction(**fun, pos); - mkApp(v, **fun, w); + state.forceFunction(**state.vImportedDrvToDerivation, pos); + mkApp(v, **state.vImportedDrvToDerivation, w); state.forceAttrs(v, pos); } |