mirror of
https://github.com/skylot/jadx.git
synced 2024-11-23 12:50:02 +00:00
fix: handle possible concurrent exception in method codegen (#1685)
This commit is contained in:
parent
2f301bf150
commit
49fa320989
@ -322,19 +322,25 @@ public class ClassGen {
|
||||
if (inlineAttr == null || inlineAttr.notNeeded()) {
|
||||
return false;
|
||||
}
|
||||
if (mth.getUseIn().isEmpty()) {
|
||||
mth.add(AFlag.DONT_GENERATE);
|
||||
return true;
|
||||
try {
|
||||
if (mth.getUseIn().isEmpty()) {
|
||||
mth.add(AFlag.DONT_GENERATE);
|
||||
return true;
|
||||
}
|
||||
List<MethodNode> useInCompleted = mth.getUseIn().stream()
|
||||
.filter(m -> m.getTopParentClass().getState().isProcessComplete())
|
||||
.collect(Collectors.toList());
|
||||
if (useInCompleted.isEmpty()) {
|
||||
mth.add(AFlag.DONT_GENERATE);
|
||||
return true;
|
||||
}
|
||||
mth.addDebugComment("Method not inlined, still used in: " + useInCompleted);
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
// check failed => keep method
|
||||
mth.addWarnComment("Failed to check method usage", e);
|
||||
return false;
|
||||
}
|
||||
List<MethodNode> useInCompleted = mth.getUseIn().stream()
|
||||
.filter(m -> m.getTopParentClass().getState().isProcessComplete())
|
||||
.collect(Collectors.toList());
|
||||
if (useInCompleted.isEmpty()) {
|
||||
mth.add(AFlag.DONT_GENERATE);
|
||||
return true;
|
||||
}
|
||||
mth.addDebugComment("Method not inlined, still used in: " + useInCompleted);
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isMethodsPresents() {
|
||||
|
Loading…
Reference in New Issue
Block a user