diff options
-rw-r--r-- | third_party/nix/src/libexpr/primops.cc | 9 | ||||
-rw-r--r-- | third_party/nix/src/tests/lang/eval-okay-sort.nix (renamed from third_party/nix/src/tests/lang/disabled/eval-okay-sort.nix) | 0 |
2 files changed, 5 insertions, 4 deletions
diff --git a/third_party/nix/src/libexpr/primops.cc b/third_party/nix/src/libexpr/primops.cc index 34d659675bf5..7819dd4b1380 100644 --- a/third_party/nix/src/libexpr/primops.cc +++ b/third_party/nix/src/libexpr/primops.cc @@ -1600,9 +1600,10 @@ static void prim_sort(EvalState& state, const Pos& pos, Value** args, state.forceList(*args[1], pos); // Copy of the input list which can be sorted in place. - auto outlist = new NixList(*args[1]->list); + v.type = tList; + v.list = new NixList(*args[1]->list); - std::for_each(outlist->begin(), outlist->end(), + std::for_each(v.list->begin(), v.list->end(), [&](Value* val) { state.forceValue(*val); }); auto comparator = [&](Value* a, Value* b) { @@ -1612,8 +1613,8 @@ static void prim_sort(EvalState& state, const Pos& pos, Value** args, return CompareValues()(a, b); } - Value vTmp1; - Value vTmp2; + Value vTmp1{}; + Value vTmp2{}; state.callFunction(*args[0], *a, vTmp1, pos); state.callFunction(vTmp1, *b, vTmp2, pos); return state.forceBool(vTmp2, pos); diff --git a/third_party/nix/src/tests/lang/disabled/eval-okay-sort.nix b/third_party/nix/src/tests/lang/eval-okay-sort.nix index 8299c3a4a3aa..8299c3a4a3aa 100644 --- a/third_party/nix/src/tests/lang/disabled/eval-okay-sort.nix +++ b/third_party/nix/src/tests/lang/eval-okay-sort.nix |