Skip to content

Commit

Permalink
modified CopyPropagator to function as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilagichani14 committed Aug 16, 2024
1 parent f4bab2a commit 26e0e7b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import sootup.core.jimple.common.constant.NullConstant;
import sootup.core.jimple.common.expr.JCastExpr;
import sootup.core.jimple.common.stmt.AbstractDefinitionStmt;
import sootup.core.jimple.common.stmt.InvokableStmt;
import sootup.core.jimple.common.stmt.JAssignStmt;
import sootup.core.jimple.common.stmt.Stmt;
import sootup.core.model.Body;
Expand Down Expand Up @@ -141,7 +142,7 @@ else if (rhs instanceof Local && !rhs.equivTo(use)) {

private Stmt replaceUse(
@Nonnull MutableStmtGraph graph, @Nonnull Stmt stmt, @Nonnull Value use, @Nonnull Value rhs) {
if (!use.equivTo(rhs) || rhs != use) {
if (!use.equivTo(rhs)) { // TODO: ms: check if rhs!=use would be enough
Stmt newStmt = stmt.withNewUse(use, rhs);
if (newStmt != stmt) {
graph.replaceNode(stmt, newStmt);
Expand Down

0 comments on commit 26e0e7b

Please sign in to comment.