mirror of
https://github.com/skylot/jadx.git
synced 2025-02-21 13:33:47 +00:00
fix: workaround to make method inline deterministic (#1089)
This commit is contained in:
parent
f9da6e00ed
commit
58e8268126
@ -125,6 +125,22 @@ public class ProcessClass {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and process class without its deps
|
||||
*/
|
||||
public void forceProcess(ClassNode cls) {
|
||||
ClassNode topParentClass = cls.getTopParentClass();
|
||||
if (topParentClass != cls) {
|
||||
forceProcess(topParentClass);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
process(cls, false);
|
||||
} catch (Throwable e) {
|
||||
throw new JadxRuntimeException("Failed to process class: " + cls.getFullName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public void initPasses(RootNode root) {
|
||||
for (IDexTreeVisitor pass : passes) {
|
||||
try {
|
||||
|
@ -59,12 +59,17 @@ public class InlineMethods extends AbstractVisitor {
|
||||
}
|
||||
MethodNode callMth = (MethodNode) callMthDetails;
|
||||
try {
|
||||
// TODO: sort inner classes process order by dependencies!
|
||||
MethodInlineAttr mia = MarkMethodsForInline.process(callMth);
|
||||
if (mia == null) {
|
||||
// method not yet loaded => will retry at codegen stage
|
||||
callMth.getParentClass().reloadAtCodegenStage();
|
||||
return;
|
||||
// method is not yet loaded => force process
|
||||
mth.addDebugComment("Class process forced to load method for inline: " + callMth);
|
||||
mth.root().getProcessClasses().forceProcess(callMth.getParentClass());
|
||||
// run check again
|
||||
mia = MarkMethodsForInline.process(callMth);
|
||||
if (mia == null) {
|
||||
mth.addWarnComment("Failed to check method for inline after forced process" + callMth);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (mia.notNeeded()) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user