about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T16·51+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T16·59+0200
commitc28de6d96e7bfea834a44deac5217d4696fa8d86 (patch)
tree14e467d87b1677d09e2c7c06766414e24a713289 /src/libexpr/eval.cc
parent8b31ffd10de44871a3912184fedbeca57d8cf60f (diff)
Pass position information to primop calls
For example:

  error: `tail' called on an empty list, at
    /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/ex-2/default.nix:13:7
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index d26a0e2584..3a2a84916e 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -794,7 +794,7 @@ void ExprApp::eval(EvalState & state, Env & env, Value & v)
 }
 
 
-void EvalState::callPrimOp(Value & fun, Value & arg, Value & v)
+void EvalState::callPrimOp(Value & fun, Value & arg, Value & v, const Pos & pos)
 {
     /* Figure out the number of arguments still needed. */
     unsigned int argsDone = 0;
@@ -820,7 +820,7 @@ void EvalState::callPrimOp(Value & fun, Value & arg, Value & v)
         /* And call the primop. */
         nrPrimOpCalls++;
         if (countCalls) primOpCalls[primOp->primOp->name]++;
-        primOp->primOp->fun(*this, vArgs, v);
+        primOp->primOp->fun(*this, pos, vArgs, v);
     } else {
         Value * fun2 = allocValue();
         *fun2 = fun;
@@ -834,7 +834,7 @@ void EvalState::callPrimOp(Value & fun, Value & arg, Value & v)
 void EvalState::callFunction(Value & fun, Value & arg, Value & v, const Pos & pos)
 {
     if (fun.type == tPrimOp || fun.type == tPrimOpApp) {
-        callPrimOp(fun, arg, v);
+        callPrimOp(fun, arg, v, pos);
         return;
     }