Skip to content

Commit

Permalink
[DEX] Fix: Proper wide instruction comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
REAndroid committed Nov 25, 2024
1 parent 31d9adf commit c862480
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/main/java/com/reandroid/dex/ins/SizeXIns.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,13 @@ public boolean equals(Object obj) {
return false;
}
}
if(getSectionType() != null){
if (getSectionType() != null) {
return Objects.equals(getKey(), sizeXIns.getKey());
}else {
return getData() == sizeXIns.getData();
} else {
if (this instanceof ConstNumberLong) {
return getLong() == sizeXIns.getLong();
}
return getData() == sizeXIns.getLong();
}
}

Expand All @@ -339,10 +342,14 @@ public int hashCode() {
}
hash = hash * 31;
Key key = getKey();
if(key != null){
if (key != null) {
hash = hash + key.hashCode();
}else {
hash = hash + getData();
} else {
if (this instanceof ConstNumberLong) {
hash = hash * 31 + Long.hashCode(getLong());
} else {
hash = hash * 31 + getData();
}
}
return hash;
}
Expand Down

0 comments on commit c862480

Please sign in to comment.