Skip to content

Commit

Permalink
Ensure enough space in attrset bindings when using both __overrides a…
Browse files Browse the repository at this point in the history
…nd dynamic attributes
  • Loading branch information
puckipedia committed Nov 25, 2019
1 parent d12d69e commit cd55f91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libexpr/eval.cc
Expand Up @@ -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) {
Expand Down

0 comments on commit cd55f91

Please sign in to comment.