about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-03-31T09·54+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-03-31T09·54+0000
commit4c53ca2692f0a1325ec2d085ac3a6ee313b3cdb2 (patch)
tree734ef720d29b69c77c0e1a051b8aed6998d4f392 /src/libexpr/eval.cc
parent7f19e03c65693ae6a5eefc7e681b3003676d38eb (diff)
* Compare nulls.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 1365faf8c0..4624cbeaf1 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -417,7 +417,7 @@ void EvalState::eval(Env & env, Expr e, Value & v)
         PathSet context;
         std::ostringstream s;
         
-        bool first = true, isPath;
+        bool first = true, isPath = false;
         
         for (ATermIterator i(es); i; ++i) {
             eval(env, *i, v);
@@ -788,6 +788,9 @@ bool EvalState::eqValues(Value & v1, Value & v2)
             /* !!! contexts */
             return strcmp(v1.string.s, v2.string.s) == 0;
 
+        case tNull:
+            return true;
+
         case tList:
             if (v2.type != tList || v1.list.length != v2.list.length) return false;
             for (unsigned int n = 0; n < v1.list.length; ++n)
@@ -803,7 +806,7 @@ bool EvalState::eqValues(Value & v1, Value & v2)
         }
 
         default:
-            throw Error("cannot compare given values");
+            throw Error(format("cannot compare %1% with %2%") % showType(v1) % showType(v2));
     }
 }