From 2bac04c5ff66092cf1cb42096feb3554a92fa98e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 31 Jul 2015 20:28:25 +0200 Subject: [PATCH] Fix stack consumption --- src/libexpr/eval-inline.hh | 6 +++--- src/libexpr/eval.cc | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/libexpr/eval-inline.hh b/src/libexpr/eval-inline.hh index 4abc485aa..8dee5ee46 100644 --- a/src/libexpr/eval-inline.hh +++ b/src/libexpr/eval-inline.hh @@ -8,9 +8,9 @@ namespace nix { -LocalNoInlineNoReturn(void throwEvalError(const FormatOrString & fs)) +LocalNoInlineNoReturn(void throwEvalError(const char * s, const Pos & pos)) { - throw EvalError(fs); + throw EvalError(format(s) % pos); } LocalNoInlineNoReturn(void throwTypeError(const char * s, const Value & v)) @@ -44,7 +44,7 @@ void EvalState::forceValue(Value & v, const Pos & pos) else if (v.type == tApp) callFunction(*v.app.left, *v.app.right, v, noPos); else if (v.type == tBlackhole) - throwEvalError(format("infinite recursion encountered, at %1%") % pos); + throwEvalError("infinite recursion encountered, at %1%", pos); } diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index ec02e61b0..74f88e498 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -358,11 +358,6 @@ LocalNoInlineNoReturn(void throwEvalError(const char * s, const string & s2)) throw EvalError(format(s) % s2); } -LocalNoInlineNoReturn(void throwEvalError(const char * s, const Pos & pos)) -{ - throw EvalError(format(s) % pos); -} - LocalNoInlineNoReturn(void throwEvalError(const char * s, const string & s2, const Pos & pos)) { throw EvalError(format(s) % s2 % pos);