diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index 7e217b7f1..e160cf53a 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -1812,7 +1812,7 @@ void CheckCondition::checkCompareValueOutOfTypeRange() long long typeMaxValue; if (typeTok->valueType()->sign != ValueType::Sign::SIGNED) typeMaxValue = unsignedTypeMaxValue; - else if (bits >= mSettings->int_bit && valueTok->valueType()->sign != ValueType::Sign::SIGNED) + else if (bits >= mSettings->int_bit && (!valueTok->valueType() || valueTok->valueType()->sign != ValueType::Sign::SIGNED)) typeMaxValue = unsignedTypeMaxValue; else typeMaxValue = unsignedTypeMaxValue / 2;