From 9bc43fca1d3e06d88ef00aaaf243a9b3433dcac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 20 Jan 2020 08:10:39 +0100 Subject: [PATCH] Fixed crash when printing out ValueFlow debug output --- lib/token.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/token.cpp b/lib/token.cpp index b0f438894..2a2b2f1f1 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -1550,6 +1550,8 @@ void Token::printValueFlow(bool xml, std::ostream &out) const for (const Token *tok = this; tok; tok = tok->next()) { if (!tok->mImpl->mValues) continue; + if (tok->mImpl->mValues->empty()) // Values might be removed by removeContradictions + continue; if (xml) out << " mImpl->mValues << "\">" << std::endl; else if (line != tok->linenr())