From 1c55544a428c61448dcaa4b431f20bde52c3991e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 1 Apr 2023 22:05:06 +0200 Subject: eval: Fix crash on missing printValue tBlackhole case Fixes #8119 --- src/libexpr/eval.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 584bbc879..22337a3ff 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -173,7 +173,17 @@ void Value::print(const SymbolTable & symbols, std::ostream & str, case tFloat: str << fpoint; break; + case tBlackhole: + // Although we know for sure that it's going to be an infinite recursion + // when this value is accessed _in the current context_, it's likely + // that the user will misinterpret a simpler «infinite recursion» output + // as a definitive statement about the value, while in fact it may be + // a valid value after `builtins.trace` and perhaps some other steps + // have completed. + str << "«potential infinite recursion»"; + break; default: + printError("Nix evaluator internal error: Value::print(): invalid value type %1%", internalType); abort(); } } -- cgit v1.2.3