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:
Shea Levy 2012-07-24 12:05:27 -04:00 committed by Eelco Dolstra
parent 1ef2d5765b
commit f5954e2d94
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ static void prim_import(EvalState & state, Value * * args, Value & v)
if (isStorePath(path) && store->isValidPath(path) && isDerivation(path)) {
Derivation drv = parseDerivation(readFile(path));
Value w;
Value & w = *state.allocValue();
state.mkAttrs(w, 1 + drv.outputs.size());
mkString(*state.allocAttr(w, state.sDrvPath), path, singleton<PathSet>("=" + path));
state.mkList(*state.allocAttr(w, state.symbols.create("outputs")), drv.outputs.size());