From bfd36402acc976c32ec8349a2a25fa4288d65475 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Mar 2024 18:11:24 +0100 Subject: [PATCH] EvalCache: Fix missing format string argument Fixes terminate called after throwing an instance of 'boost::wrapexcept' what(): boost::too_few_args: format-string referred to more arguments than were passed Aborted (core dumped) for type errors in AttrCursor. --- src/libexpr/eval-cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc index 2fc69e796..1538eb056 100644 --- a/src/libexpr/eval-cache.cc +++ b/src/libexpr/eval-cache.cc @@ -581,7 +581,7 @@ std::string AttrCursor::getString() auto & v = forceValue(); if (v.type() != nString && v.type() != nPath) - root->state.error("'%s' is not a string but %s", getAttrPathStr()).debugThrow(); + root->state.error("'%s' is not a string but %s", getAttrPathStr(), showType(v)).debugThrow(); return v.type() == nString ? v.c_str() : v.path().to_string(); } @@ -630,7 +630,7 @@ string_t AttrCursor::getStringWithContext() else if (v.type() == nPath) return {v.path().to_string(), {}}; else - root->state.error("'%s' is not a string but %s", getAttrPathStr()).debugThrow(); + root->state.error("'%s' is not a string but %s", getAttrPathStr(), showType(v)).debugThrow(); } bool AttrCursor::getBool()