fix: don't skip method instructions in fallback mode (#1063)

This commit is contained in:
Skylot
2020-12-24 12:52:39 +00:00
parent 23f088105e
commit 7227f1ac78
@@ -291,13 +291,15 @@ public class MethodGen {
code.startLine("// Can't load method instructions.");
return;
}
long insnCountEstimate = Stream.of(insnArr)
.filter(Objects::nonNull)
.filter(insn -> insn.getType() != InsnType.NOP)
.count();
if (insnCountEstimate > 100) {
code.startLine("// Method dump skipped, instructions count: " + insnArr.length);
return;
if (fallbackOption == COMMENTED_DUMP) {
long insnCountEstimate = Stream.of(insnArr)
.filter(Objects::nonNull)
.filter(insn -> insn.getType() != InsnType.NOP)
.count();
if (insnCountEstimate > 100) {
code.startLine("// Method dump skipped, instructions count: " + insnArr.length);
return;
}
}
code.incIndent();
if (mth.getThisArg() != null) {