Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <cmath>


namespace nix {


Expand Down Expand Up @@ -2470,8 +2469,8 @@ static void prim_catAttrs(EvalState & state, const PosIdx pos, Value * * args, V
auto attrName = state.symbols.create(state.forceStringNoCtx(*args[0], pos));
state.forceList(*args[1], pos);

Value * res[args[1]->listSize()];
unsigned int found = 0;
boost::container::small_vector<Value *, 256> res(args[1]->listSize());
size_t found = 0;

for (auto v2 : args[1]->listItems()) {
state.forceAttrs(*v2, pos);
Expand Down Expand Up @@ -2798,9 +2797,8 @@ static void prim_filter(EvalState & state, const PosIdx pos, Value * * args, Val
state.forceFunction(*args[0], pos);
state.forceList(*args[1], pos);

// FIXME: putting this on the stack is risky.
Value * vs[args[1]->listSize()];
unsigned int k = 0;
boost::container::small_vector<Value *, 256> vs(args[1]->listSize());
size_t k = 0;

bool same = true;
for (unsigned int n = 0; n < args[1]->listSize(); ++n) {
Expand Down Expand Up @@ -3176,7 +3174,7 @@ static void prim_concatMap(EvalState & state, const PosIdx pos, Value * * args,
state.forceList(*args[1], pos);
auto nrLists = args[1]->listSize();

Value lists[nrLists];
boost::container::small_vector<Value, 64> lists(nrLists);
size_t len = 0;

for (unsigned int n = 0; n < nrLists; ++n) {
Expand Down