prim_import: When importing .drvs, allocate the intermediate attrset on the heap just in case it escapes the stack frame.
This commit is contained in:
parent
1ef2d5765b
commit
f5954e2d94
1 changed files with 1 additions and 1 deletions
|
@ -61,7 +61,7 @@ static void prim_import(EvalState & state, Value * * args, Value & v)
|
||||||
|
|
||||||
if (isStorePath(path) && store->isValidPath(path) && isDerivation(path)) {
|
if (isStorePath(path) && store->isValidPath(path) && isDerivation(path)) {
|
||||||
Derivation drv = parseDerivation(readFile(path));
|
Derivation drv = parseDerivation(readFile(path));
|
||||||
Value w;
|
Value & w = *state.allocValue();
|
||||||
state.mkAttrs(w, 1 + drv.outputs.size());
|
state.mkAttrs(w, 1 + drv.outputs.size());
|
||||||
mkString(*state.allocAttr(w, state.sDrvPath), path, singleton<PathSet>("=" + path));
|
mkString(*state.allocAttr(w, state.sDrvPath), path, singleton<PathSet>("=" + path));
|
||||||
state.mkList(*state.allocAttr(w, state.symbols.create("outputs")), drv.outputs.size());
|
state.mkList(*state.allocAttr(w, state.symbols.create("outputs")), drv.outputs.size());
|
||||||
|
|
Loading…
Reference in a new issue