forked from lix-project/lix
Fix use after free with vImportedDrvToDerivation
This commit is contained in:
parent
8bc76acc7c
commit
8656b130ea
|
@ -101,6 +101,7 @@ public:
|
||||||
const ref<Store> buildStore;
|
const ref<Store> buildStore;
|
||||||
|
|
||||||
RootValue vCallFlake = nullptr;
|
RootValue vCallFlake = nullptr;
|
||||||
|
RootValue vImportedDrvToDerivation = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SrcToStore srcToStore;
|
SrcToStore srcToStore;
|
||||||
|
|
|
@ -160,16 +160,15 @@ static void import(EvalState & state, const Pos & pos, Value & vPath, Value * vS
|
||||||
}
|
}
|
||||||
w.attrs->sort();
|
w.attrs->sort();
|
||||||
|
|
||||||
static RootValue fun;
|
if (!state.vImportedDrvToDerivation) {
|
||||||
if (!fun) {
|
state.vImportedDrvToDerivation = allocRootValue(state.allocValue());
|
||||||
fun = allocRootValue(state.allocValue());
|
|
||||||
state.eval(state.parseExprFromString(
|
state.eval(state.parseExprFromString(
|
||||||
#include "imported-drv-to-derivation.nix.gen.hh"
|
#include "imported-drv-to-derivation.nix.gen.hh"
|
||||||
, "/"), **fun);
|
, "/"), **state.vImportedDrvToDerivation);
|
||||||
}
|
}
|
||||||
|
|
||||||
state.forceFunction(**fun, pos);
|
state.forceFunction(**state.vImportedDrvToDerivation, pos);
|
||||||
mkApp(v, **fun, w);
|
mkApp(v, **state.vImportedDrvToDerivation, w);
|
||||||
state.forceAttrs(v, pos);
|
state.forceAttrs(v, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue