From 17ab0a4e9a186c44721fbf9d9bfb65b35f0ee83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 31 Dec 2015 14:07:38 +0100 Subject: [PATCH] Fixed #7246 (crash: CheckType::checkLongCast()) --- lib/checktype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checktype.cpp b/lib/checktype.cpp index 63e0de35b..84219748c 100644 --- a/lib/checktype.cpp +++ b/lib/checktype.cpp @@ -255,7 +255,7 @@ void CheckType::checkLongCast() if (tok->str() == "return") { if (Token::Match(tok->astOperand1(), "<<|*")) { const ValueType *type = tok->astOperand1()->valueType(); - if (type->type == ValueType::Type::INT && type->pointer == 0U && type->originalTypeName.empty()) + if (type && type->type == ValueType::Type::INT && type->pointer == 0U && type->originalTypeName.empty()) ret = tok; } // All return statements must have problem otherwise no warning