diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 9c096e9e1..2611415bc 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -195,8 +195,7 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[]) else if (std::strncmp(argv[i], "--verify-report=", 16) == 0) { mSettings->verification = true; mSettings->verificationReport = argv[i] + 16; - } - else if (std::strcmp(argv[i], "--debug-verify") == 0) + } else if (std::strcmp(argv[i], "--debug-verify") == 0) mSettings->debugVerification = true; // Enforce language (--language=, -x) diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 115cb2399..8b998209d 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -1579,13 +1579,15 @@ void ExprEngine::executeFunction(const Scope *functionScope, const Tokenizer *to call(callbacks, tok, bailoutValue, &data); } - if (settings->debugVerification && !trackExecution.isAllOk()) { + if (settings->debugVerification && (callbacks.empty() || !trackExecution.isAllOk())) { if (!settings->verificationReport.empty()) report << "[debug]" << std::endl; trackExecution.print(report); - if (!settings->verificationReport.empty()) - report << "[details]" << std::endl; - trackExecution.report(report, functionScope); + if (!callbacks.empty()) { + if (!settings->verificationReport.empty()) + report << "[details]" << std::endl; + trackExecution.report(report, functionScope); + } } // Write a verification report