diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-08 11:25:14 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-08 11:25:14 +0000 |
commit | 7e048eddf55637b9e81d704f6b9f1fdeca98a5ea (patch) | |
tree | c2f39dec45c5e2c6b84f7cde29fbd03438038481 /src | |
parent | af2a372bb000d4d5aeec37e43ee0f6245c1bba54 (diff) | |
download | guix-7e048eddf55637b9e81d704f6b9f1fdeca98a5ea.tar.gz |
* 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.
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/eval.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 98b6b7bdd1..e72538e608 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -681,8 +681,14 @@ bool EvalState::evalBool(Env & env, Expr e) void EvalState::forceValue(Value & v) { if (v.type == tThunk) { - //v.type = tBlackhole; - eval(*v.thunk.env, v.thunk.expr, v); + 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); |