fix minor issues
This commit is contained in:
@@ -526,7 +526,7 @@ public class InsnGen {
|
||||
);
|
||||
}
|
||||
if (!elType.isTypeKnown()) {
|
||||
LOG.warn("Unknown array element type: {} in mth: {}", elType);
|
||||
LOG.warn("Unknown array element type: {} in mth: {}", elType, mth);
|
||||
elType = insnElementType.isTypeKnown() ? insnElementType : elType.selectFirst();
|
||||
}
|
||||
StringBuilder str = new StringBuilder();
|
||||
|
||||
@@ -171,6 +171,10 @@ public class LoopRegionVisitor extends AbstractVisitor implements IRegionVisitor
|
||||
if (!arrayArg.equals(arrGetInsn.getArg(0))) {
|
||||
return null;
|
||||
}
|
||||
RegisterArg iterVar = arrGetInsn.getResult();
|
||||
if (iterVar == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// array for each loop confirmed
|
||||
len.add(AFlag.SKIP);
|
||||
@@ -179,8 +183,6 @@ public class LoopRegionVisitor extends AbstractVisitor implements IRegionVisitor
|
||||
|
||||
// inline array variable
|
||||
CodeShrinker.shrinkMethod(mth);
|
||||
|
||||
RegisterArg iterVar = arrGetInsn.getResult();
|
||||
if (arrGetInsn.contains(AFlag.WRAPPED)) {
|
||||
InsnArg wrapArg = BlockUtils.searchWrappedInsnParent(mth, arrGetInsn);
|
||||
if (wrapArg != null) {
|
||||
@@ -241,7 +243,7 @@ public class LoopRegionVisitor extends AbstractVisitor implements IRegionVisitor
|
||||
} else {
|
||||
toSkip.add(nextCall);
|
||||
}
|
||||
if (!fixIterableType(iterableArg, iterVar)) {
|
||||
if (iterVar == null || !fixIterableType(iterableArg, iterVar)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -310,7 +312,7 @@ public class LoopRegionVisitor extends AbstractVisitor implements IRegionVisitor
|
||||
}
|
||||
BlockNode block = BlockUtils.getBlockByInsn(mth, parentInsn);
|
||||
if (block == null) {
|
||||
LOG.debug("Instruction not found: {}, mth: {}", parentInsn, mth);
|
||||
LOG.debug(" LoopRegionVisitor: instruction not found: {}, mth: {}", parentInsn, mth);
|
||||
return false;
|
||||
}
|
||||
return RegionUtils.isRegionContainsBlock(loopRegion, block);
|
||||
|
||||
@@ -127,6 +127,9 @@ public class SSATransform extends AbstractVisitor {
|
||||
throw new JadxRuntimeException("Can't find predecessor for " + block + " " + s);
|
||||
}
|
||||
for (PhiInsn phiInsn : phiList.getList()) {
|
||||
if (j >= phiInsn.getArgsCount()) {
|
||||
continue;
|
||||
}
|
||||
int regNum = phiInsn.getResult().getRegNum();
|
||||
SSAVar var = vars[regNum];
|
||||
if (var == null) {
|
||||
|
||||
@@ -64,6 +64,13 @@ class CodeArea extends RSyntaxTextArea {
|
||||
|
||||
private boolean isJumpToken(Token token) {
|
||||
if (token.getType() == TokenTypes.IDENTIFIER) {
|
||||
// fast skip
|
||||
if (token.length() == 1) {
|
||||
char ch = token.getTextArray()[token.getTextOffset()];
|
||||
if (ch == '.' || ch == ',' || ch == ';') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Position pos = getPosition(cls, this, token.getOffset());
|
||||
if (pos != null) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user