From 644d83e91bb5a7362bc445690f8f79a44440f3e4 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 6 Aug 2014 10:05:32 +0400 Subject: [PATCH] Resolve CID 1037105 --- lib/checkstl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index c3ab0eda4..8423a2de2 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -756,10 +756,12 @@ static bool if_findCompare(const Token * const tokBack, bool str) if (Token::Match(tok,",|==|!=")) return true; - if (str && tok->isComparisonOp()) - return true; - if (tok->isArithmeticalOp()) // result is used in some calculation - return true; // TODO: check if there is a comparison of the result somewhere + if (tok) { + if (str && tok->isComparisonOp()) + return true; + if (tok->isArithmeticalOp()) // result is used in some calculation + return true; // TODO: check if there is a comparison of the result somewhere + } return false; }