提交 5efe4bd8 编写于 作者: S Skylot

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

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册