Commit 5efe4bd8 authored by Skylot's avatar Skylot

fix: add labels from NOP instructions in fallback mode (#666)

parent 75a67140
......@@ -241,10 +241,11 @@ public class MethodGen {
}
public static void addFallbackInsns(CodeWriter code, MethodNode mth, InsnNode[] insnArr, boolean addLabels) {
code.incIndent();
InsnGen insnGen = new InsnGen(getFallbackMethodGen(mth), true);
InsnNode prevInsn = null;
for (InsnNode insn : insnArr) {
if (insn == null || insn.getType() == InsnType.NOP) {
if (insn == null) {
continue;
}
if (addLabels && needLabel(insn, prevInsn)) {
......@@ -252,6 +253,9 @@ public class MethodGen {
code.startLine(getLabelName(insn.getOffset()) + ':');
code.incIndent();
}
if (insn.getType() == InsnType.NOP) {
continue;
}
try {
code.startLine();
RegisterArg resArg = insn.getResult();
......@@ -272,6 +276,7 @@ public class MethodGen {
}
prevInsn = insn;
}
code.decIndent();
}
private static boolean needLabel(InsnNode insn, InsnNode prevInsn) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment