From 962b89f5023b390d8d4feaf74f7862237000c14b Mon Sep 17 00:00:00 2001 From: Grigorii Gusev Date: Mon, 11 Dec 2023 19:44:01 +0300 Subject: [PATCH] private_removing: fix bug in expression substitution --- .../Sapfor_2017/_src/Transformations/private_removing.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp index 303b7f0..c5d94f7 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/private_removing.cpp @@ -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));