Commit e1ca2904 authored by Skylot's avatar Skylot

fix: avoid ConcurrentModificationException in EliminatePhiNodes pass

parent 0fa19fb0
package jadx.core.dex.visitors.ssa; package jadx.core.dex.visitors.ssa;
import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
...@@ -111,7 +112,7 @@ public class EliminatePhiNodes extends AbstractVisitor { ...@@ -111,7 +112,7 @@ public class EliminatePhiNodes extends AbstractVisitor {
if (assignParentInsn != null) { if (assignParentInsn != null) {
assignParentInsn.setResult(newAssignArg); assignParentInsn.setResult(newAssignArg);
} }
for (RegisterArg useArg : oldSVar.getUseList()) { for (RegisterArg useArg : new ArrayList<>(oldSVar.getUseList())) {
RegisterArg newUseArg = useArg.duplicate(newRegNum, newSVar); RegisterArg newUseArg = useArg.duplicate(newRegNum, newSVar);
InsnNode parentInsn = useArg.getParentInsn(); InsnNode parentInsn = useArg.getParentInsn();
if (parentInsn != null) { if (parentInsn != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment