From a865b5553486e6a25ea5b37a0c67ef5c0c5d93e9 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Wed, 30 Oct 2024 05:29:00 +0000 Subject: [PATCH] can eval nixos system --- src/libexpr/eval.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 7373071d0aa..3ac12d85df4 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1898,7 +1898,13 @@ void ExprOpConcatLists::eval(EvalState & state, Env & env, Value & v) e1->eval(state, env, *v1); auto v2 = state.allocValue(); e2->eval(state, env, *v2); - state.concatLists(v, ValueList({v1, v2}), pos, "while evaluating one of the elements to concatenate"); + // TODO(@connorbaker): This kills me -- why do we need to create the list on the heap? Shouldn't I be able to pass + // a ValueList by value to concatLists without worrying about it being garbage collected *while the function is running*? + // If this doesn't work, then should I allocList in the test cases? + auto list = state.allocList(); + *list = list->push_back(v1); + *list = list->push_back(v2); + state.concatLists(v, *list, pos, "while evaluating one of the elements to concatenate"); }