private_removing: fix bug in expression substitution

This commit is contained in:
2023-12-11 19:44:01 +03:00
parent f42ed16096
commit 962b89f502

View File

@@ -468,10 +468,8 @@ static SgExpression* substituteExpressions(SgExpression* exp,
if (exp->variant() == ARRAY_REF)
{
const auto& refToExp = refToExpMap.find(exp->unparse());
if (refToExp == refToExpMap.end())
return exp;
return refToExp->second;
if (refToExp != refToExpMap.end())
return refToExp->second;
}
exp->setLhs(substituteExpressions(exp->lhs(), refToExpMap));