diff options
author | Domen Kožar <domen@dev.si> | 2020-04-18 14:05:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 14:05:21 +0200 |
commit | 25ed842725864f1fa9330d3c2ea6f741c63fca07 (patch) | |
tree | 613a14262bef6c5c00e8de495d59526f5971a0b7 /src/libexpr/eval.cc | |
parent | efaffaa9d1de38efecb718aa7a99ba1f2e342ade (diff) | |
parent | b865b5b40c13cfff32e1a0ab685baff1bef5ae5d (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.cc | 6 |
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; |