Fixed #7246 (crash: CheckType::checkLongCast())

This commit is contained in:
Daniel Marjamäki 2015-12-31 14:07:38 +01:00
parent 9f6890512c
commit 17ab0a4e9a
1 changed files with 1 additions and 1 deletions

View File

@ -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