mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
* Fix blackholing. If evaluation fails due to an assertion failure,
then the blackhole has to be removed to ensure that repeated evaluation of the same value gives an assertion failure again rather than an "infinite recursion" error.
This commit is contained in:
parent
af2a372bb0
commit
7e048eddf5
1 changed files with 8 additions and 2 deletions
|
@ -681,8 +681,14 @@ bool EvalState::evalBool(Env & env, Expr e)
|
|||
void EvalState::forceValue(Value & v)
|
||||
{
|
||||
if (v.type == tThunk) {
|
||||
//v.type = tBlackhole;
|
||||
ValueType saved = v.type;
|
||||
try {
|
||||
v.type = tBlackhole;
|
||||
eval(*v.thunk.env, v.thunk.expr, v);
|
||||
} catch (Error & e) {
|
||||
v.type = saved;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
else if (v.type == tCopy) {
|
||||
forceValue(*v.val);
|
||||
|
|
Loading…
Reference in a new issue