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,9 +468,7 @@ static SgExpression* substituteExpressions(SgExpression* exp,
if (exp->variant() == ARRAY_REF) if (exp->variant() == ARRAY_REF)
{ {
const auto& refToExp = refToExpMap.find(exp->unparse()); const auto& refToExp = refToExpMap.find(exp->unparse());
if (refToExp == refToExpMap.end()) if (refToExp != refToExpMap.end())
return exp;
return refToExp->second; return refToExp->second;
} }