aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-11-26 20:14:55 +0100
committerGitHub <noreply@github.com>2019-11-26 20:14:55 +0100
commit872740cf60ca29820a25e61882a192f6abe9d68e (patch)
tree7c4d83922e69df6aa9b79a35e7db1afa53df2e8f /src/libexpr
parentc13193017fdcb910627698e343c2df4183d91f8f (diff)
parentcdadbf770855e828a0f64d70a47db43e920ad137 (diff)
Merge pull request #3238 from puckipedia/attrset-overrides-dynamic
Ensure enough space in attrset bindings
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 62812f90a..3a9b7a3c0 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -875,7 +875,7 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v)
if (hasOverrides) {
Value * vOverrides = (*v.attrs)[overrides->second.displ].value;
state.forceAttrs(*vOverrides);
- Bindings * newBnds = state.allocBindings(v.attrs->size() + vOverrides->attrs->size());
+ Bindings * newBnds = state.allocBindings(v.attrs->capacity() + vOverrides->attrs->size());
for (auto & i : *v.attrs)
newBnds->push_back(i);
for (auto & i : *vOverrides->attrs) {