From 809cec2b58576bd512ebdd1db6ffa38e25f69544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 27 Nov 2020 12:06:59 +0100 Subject: [PATCH] Fix crashes when Variable::valueType is nullptr, this can happen when decltype(unknown type) is used. --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index e264cbf82..7ae70da23 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1265,7 +1265,7 @@ void CheckOther::checkPassByReference() 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. // Ensure that it is a large object. if (!var->type()->classScope)