Fix clang-tidy bugprone-branch-clone warnings

This commit is contained in:
Tim Wojtulewicz 2025-04-15 18:48:57 -07:00
parent 92854e95d3
commit dbecfb5a2a
32 changed files with 132 additions and 247 deletions

View file

@ -232,16 +232,8 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
if ( ! pvt )
reporter->InternalError("bad aggregate Val in CompositeHash::RecoverOneVal()");
else if ( t->Tag() != TYPE_FUNC && ! same_type(pvt, t) )
// ### Maybe fix later, but may be fundamentally un-checkable --US
{
reporter->InternalError("inconsistent aggregate Val in CompositeHash::RecoverOneVal()");
*pval = nullptr;
return false;
}
// ### A crude approximation for now.
else if ( t->Tag() == TYPE_FUNC && pvt->Tag() != TYPE_FUNC ) {
else if ( (t->Tag() != TYPE_FUNC && ! same_type(pvt, t)) ||
(t->Tag() == TYPE_FUNC && pvt->Tag() != TYPE_FUNC) ) {
reporter->InternalError("inconsistent aggregate Val in CompositeHash::RecoverOneVal()");
*pval = nullptr;
return false;