Fix issue detected by Coverity, vt2 is null checked and then dereferenced
This commit is contained in:
parent
d2698733c3
commit
55aec0ef1b
|
@ -4836,7 +4836,7 @@ void SymbolDatabase::setValueType(Token *tok, const ValueType &valuetype)
|
||||||
|
|
||||||
bool ternary = parent->str() == ":" && parent->astParent() && parent->astParent()->str() == "?";
|
bool ternary = parent->str() == ":" && parent->astParent() && parent->astParent()->str() == "?";
|
||||||
if (ternary) {
|
if (ternary) {
|
||||||
if (vt1->pointer == vt2->pointer && vt1->type == vt2->type && vt1->sign == vt2->sign)
|
if (vt2 && vt1->pointer == vt2->pointer && vt1->type == vt2->type && vt1->sign == vt2->sign)
|
||||||
setValueType(parent, *vt2);
|
setValueType(parent, *vt2);
|
||||||
parent = const_cast<Token*>(parent->astParent());
|
parent = const_cast<Token*>(parent->astParent());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue