-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Code restructure failed for a small method #845
Comments
I'll look into it. The problem seems to be in
I've narrowed down the problem to this line in IfRegionVisitor.java:
|
So, here's the flow graph of the decompiled method. In TernaryMod.java, in method private static void clearConditionBlocks(List<BlockNode> conditionBlocks, BlockNode header) {
for (BlockNode block : conditionBlocks) {
if (block != header) {
block.getInstructions().clear();
block.add(AFlag.REMOVE);
}
}
} Variable block.getInstructions().clear(); If you comment it out, the method decompiles successfully. I can't understand why removing the instructions of the if-conditions, in this case, makes block 0x0006 disappear. Maybe @skylot can shed some light on this. |
So, turns out this issue has the same root cause as #820. The problem is that, when looking for successor Now, regarding the fix. I guess @skylot will decide how to handle this. One solution I can see is, in However, to solve both this and #820, I did the following. In IfMakerHelper.java, I modified the following code: if (assignInlineNeeded) {
for (BlockNode mergedBlock : currentIf.getMergedBlocks()) {
if (mergedBlock.contains(AFlag.LOOP_START)) {
// don't inline assigns into loop condition
return currentIf;
}
}
} To look like this: if (assignInlineNeeded) {
return currentIf;
} This will skip merging of |
@huku- thanks for analysis! |
@skylot |
The failing code with a missing assignment in class
com.antivirus.o.aaf
its smali
Hope it can help to find a root issue much faster
APK: https://drive.google.com/file/d/159bPvATZpnVkOKOm0AiK9lHy1rFVdI1s/view?usp=sharing
The text was updated successfully, but these errors were encountered: