diff options
author | Puck Meerburg <puck@puckipedia.com> | 2019-11-25 12:37:14 +0000 |
---|---|---|
committer | Puck Meerburg <puck@puckipedia.com> | 2019-11-25 12:37:14 +0000 |
commit | cd55f91ad2075d5ebb506950dfbc4161cab22db5 (patch) | |
tree | 6e42d72c51422011afa5c33879c238db8952adda /src/libexpr/eval.cc | |
parent | d12d69ea1a871d631d77c8ef5e8468b4a2bff80f (diff) |
Ensure enough space in attrset bindings when using both __overrides and dynamic attributes
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 2 |
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) { |