Skip to content

Commit

Permalink
Fix aborts when using builtins.getFlake
Browse files Browse the repository at this point in the history
In that case, 'self' could refer to a value on the stack, so accessing
'self.rev' would abort.
  • Loading branch information
edolstra committed Oct 2, 2019
1 parent 780c1a8 commit 90d6018
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libexpr/flake/flake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,9 @@ static void prim_callFlake(EvalState & state, const Pos & pos, Value * * args, V
void callFlake(EvalState & state,
const Flake & flake,
const LockedInputs & lockedInputs,
Value & vRes)
Value & vResFinal)
{
auto & vRes = *state.allocValue();
auto & vInputs = *state.allocValue();

state.mkAttrs(vInputs, flake.inputs.size() + 1);
Expand Down Expand Up @@ -617,6 +618,8 @@ void callFlake(EvalState & state,
state.callFunction(vCall, *flake.vOutputs, vCall2, noPos);
state.callFunction(vCall2, vInputs, vCall3, noPos);
state.callFunction(vCall3, vSourceInfo, vRes, noPos);

vResFinal = vRes;
}

void callFlake(EvalState & state,
Expand Down

0 comments on commit 90d6018

Please sign in to comment.