Skip to content

Commit

Permalink
fix: don't add cast for PHI insn (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Oct 30, 2020
1 parent 804c8ef commit a22efc2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,12 @@ private int tryInsertVarCast(MethodNode mth, SSAVar var) {
private boolean insertAssignCast(MethodNode mth, SSAVar var, ArgType castType) {
RegisterArg assignArg = var.getAssign();
InsnNode assignInsn = assignArg.getParentInsn();
if (assignInsn == null) {
return false;
}
if (assignInsn.getType() == InsnType.PHI) {
return false;
}
BlockNode assignBlock = BlockUtils.getBlockByInsn(mth, assignInsn);
if (assignBlock == null) {
return false;
Expand Down

0 comments on commit a22efc2

Please sign in to comment.