1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

C API: Require non-thunk value from primop definition

This commit is contained in:
Robert Hensing 2024-05-23 18:36:40 +02:00
parent 8884227045
commit 8ef6efc184
2 changed files with 50 additions and 0 deletions

View file

@ -100,6 +100,15 @@ static void nix_c_primop_wrapper(
.debugThrow();
}
if (vTmp.type() == nix::nThunk) {
// We might allow this in the future if it makes sense for the evaluator
// e.g. implementing tail recursion by returning a thunk to the next
// "iteration". Until then, this is most likely a mistake or misunderstanding.
state.error<nix::EvalError>("Implementation error in custom function: return value must not be a thunk")
.atPos(pos)
.debugThrow();
}
v = vTmp;
}