aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2020-04-18 14:05:21 +0200
committerGitHub <noreply@github.com>2020-04-18 14:05:21 +0200
commit25ed842725864f1fa9330d3c2ea6f741c63fca07 (patch)
tree613a14262bef6c5c00e8de495d59526f5971a0b7 /src/libexpr/eval.cc
parentefaffaa9d1de38efecb718aa7a99ba1f2e342ade (diff)
parentb865b5b40c13cfff32e1a0ab685baff1bef5ae5d (diff)
Merge pull request #3502 from NixOS/more-pos
pass Pos to forceValue to improve infinite recursion error
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 2f5b1db47..f2c20dd68 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1510,7 +1510,7 @@ NixFloat EvalState::forceFloat(Value & v, const Pos & pos)
bool EvalState::forceBool(Value & v, const Pos & pos)
{
- forceValue(v);
+ forceValue(v, pos);
if (v.type != tBool)
throwTypeError("value is %1% while a Boolean was expected, at %2%", v, pos);
return v.boolean;
@@ -1525,7 +1525,7 @@ bool EvalState::isFunctor(Value & fun)
void EvalState::forceFunction(Value & v, const Pos & pos)
{
- forceValue(v);
+ forceValue(v, pos);
if (v.type != tLambda && v.type != tPrimOp && v.type != tPrimOpApp && !isFunctor(v))
throwTypeError("value is %1% while a function was expected, at %2%", v, pos);
}
@@ -1602,7 +1602,7 @@ std::optional<string> EvalState::tryAttrsToString(const Pos & pos, Value & v,
string EvalState::coerceToString(const Pos & pos, Value & v, PathSet & context,
bool coerceMore, bool copyToStore)
{
- forceValue(v);
+ forceValue(v, pos);
string s;