Fix a bunch of variable shadowing issues from LGTM

This commit is contained in:
Tim Wojtulewicz 2022-11-02 15:54:51 -07:00
parent f8eb2d9241
commit e8dbfc1cb0
10 changed files with 28 additions and 27 deletions

View file

@ -333,9 +333,10 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
{
ValPtr v;
Attributes* a = rt->FieldDecl(i)->attrs.get();
bool optional = (a && a->Find(ATTR_OPTIONAL));
bool is_optional = (a && a->Find(ATTR_OPTIONAL));
if ( ! RecoverOneVal(hk, rt->GetFieldType(i).get(), &v, optional, false) )
if ( ! RecoverOneVal(hk, rt->GetFieldType(i).get(), &v, is_optional,
false) )
{
*pval = nullptr;
return false;
@ -345,7 +346,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
// abort() and broken the call tree that clang-tidy is relying on to
// get the error described.
// NOLINTNEXTLINE(clang-analyzer-core.uninitialized.Branch)
if ( ! (v || optional) )
if ( ! (v || is_optional) )
{
reporter->InternalError(
"didn't recover expected number of fields from HashKey");