From 964b744c968d042f4870751b463b922bf98c178f Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Sat, 29 Apr 2017 07:02:49 +0200 Subject: [PATCH] Fixed #7990 (crash: SymbolDatabase::printOut()) --- lib/symboldatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 87fe30af0..a0a06ee2c 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2698,7 +2698,7 @@ void SymbolDatabase::printOut(const char *title) const std::cout << " retDef: " << tokenToString(func->retDef, _tokenizer) << std::endl; if (func->retDef) { std::cout << " "; - for (const Token * tok = func->retDef; tok != func->tokenDef; tok = tok->next()) + for (const Token * tok = func->retDef; tok && tok != func->tokenDef && !Token::Match(tok, "{|;"); tok = tok->next()) std::cout << " " << tokenType(tok); std::cout << std::endl; }