Fix crashes when Variable::valueType is nullptr, this can happen when decltype(unknown type) is used.

This commit is contained in:
Daniel Marjamäki 2020-11-27 12:06:59 +01:00
parent 0bbd18f364
commit 809cec2b58
1 changed files with 1 additions and 1 deletions

View File

@ -1265,7 +1265,7 @@ void CheckOther::checkPassByReference()
bool inconclusive = false; bool inconclusive = false;
if (var->valueType()->type == ValueType::Type::CONTAINER) { if (var->valueType() && var->valueType()->type == ValueType::Type::CONTAINER) {
} else if (var->type() && !var->type()->isEnumType()) { // Check if type is a struct or class. } else if (var->type() && !var->type()->isEnumType()) { // Check if type is a struct or class.
// Ensure that it is a large object. // Ensure that it is a large object.
if (!var->type()->classScope) if (!var->type()->classScope)