diff options
author | Shea Levy <shea@shealevy.com> | 2012-07-24T16·05-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-25T13·30-0400 |
commit | f5954e2d940c3a41a6ed0cad45660e254eb381a3 (patch) | |
tree | 3664c3e7ff261dcc413538222c86f1716eccb559 /src/libexpr/primops.cc | |
parent | 1ef2d5765be35c3d3c13a2aea8748166f576ec8b (diff) |
prim_import: When importing .drvs, allocate the intermediate attrset on the heap just in case it escapes the stack frame.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 2ab3eda53f43..0d4efc47e6d6 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -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()); |