Fix bytecode error when calling interface functions
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 2m48s
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 2m48s
This commit is contained in:
parent
e50f941b79
commit
e6cd4038e2
@ -1077,8 +1077,8 @@ public class Codegen {
|
|||||||
descriptor = TargetMethod.getDescriptor(call.returnType() == null ? null : TargetType.Object, call.parameterTypes().stream().map(x -> TargetType.Object).toArray(TargetType[]::new));
|
descriptor = TargetMethod.getDescriptor(call.returnType() == null ? null : TargetType.Object, call.parameterTypes().stream().map(x -> TargetType.Object).toArray(TargetType[]::new));
|
||||||
|
|
||||||
int insn = INVOKEVIRTUAL;
|
int insn = INVOKEVIRTUAL;
|
||||||
if (call.isInterface()) insn = INVOKEINTERFACE;
|
if (call.isStatic()) insn = INVOKESTATIC;
|
||||||
else if (call.isStatic()) insn = INVOKESTATIC;
|
else if (call.isInterface()) insn = INVOKEINTERFACE;
|
||||||
else if (call.name().equals("<init>") || call.expr() instanceof TargetSuper || call.isPrivate()) insn = INVOKESPECIAL;
|
else if (call.name().equals("<init>") || call.expr() instanceof TargetSuper || call.isPrivate()) insn = INVOKESPECIAL;
|
||||||
|
|
||||||
mv.visitMethodInsn(insn, call.owner().getInternalName(), call.name(), descriptor, call.isInterface());
|
mv.visitMethodInsn(insn, call.owner().getInternalName(), call.name(), descriptor, call.isInterface());
|
||||||
|
@ -1034,7 +1034,6 @@ public class TestComplete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
//@Ignore("This hangs")
|
|
||||||
public void testBug309() throws Exception {
|
public void testBug309() throws Exception {
|
||||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug309.jav");
|
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug309.jav");
|
||||||
var clazz = classFiles.get("Bug309");
|
var clazz = classFiles.get("Bug309");
|
||||||
|
Loading…
Reference in New Issue
Block a user