From 7b489140e8e5bf3045ec04d08f236def6b0ff7ca Mon Sep 17 00:00:00 2001 From: sahilagichani Date: Fri, 16 Aug 2024 16:43:26 +0200 Subject: [PATCH] review changes --- .../java/sootup/java/core/interceptors/CopyPropagator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java b/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java index 4509c3fe262..1a5ba25c123 100644 --- a/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java +++ b/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java @@ -95,7 +95,7 @@ else if (rhs instanceof Local && !rhs.equivTo(use)) { Local m = (Local) rhs; if (use != m) { Integer defCount = m.getDefs(stmtGraph.getStmts()).size(); - if (defCount == null || defCount == 0) { + if (defCount == 0) { throw new RuntimeException("Variable " + m + " used without definition!"); } else if (defCount == 1) { newStmt = replaceUse(stmtGraph, newStmt, use, rhs); @@ -141,7 +141,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 (rhs != use) { Stmt newStmt = stmt.withNewUse(use, rhs); if (newStmt != stmt) { graph.replaceNode(stmt, newStmt);