private_removing: fix bugreport_1712578151

This commit is contained in:
2024-04-08 17:51:50 +03:00
parent aa0a464ead
commit 1e5ae1ef80

View File

@@ -1642,6 +1642,9 @@ static vector<DefUseStmtsPair> buildDefUsePairs(Context* ctx, const CFG_Type& CF
for (auto& instruction : blockInstructionsVector)
{
SgStatement* stmt = instruction->getInstruction()->getOperator();
if (stmt == useInsertedStmt.insertedStmt)
break;
if (stmt->variant() == ASSIGN_STAT
&& stmt->expr(0)->symbol()->identifier() == defVarName
&& !isVarChangedBetween(defVarName, stmt, useInsertedStmt.insertedStmt))