Fix bytecode error when calling interface functions
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 2m48s

This commit is contained in:
Daniel Holle 2024-04-09 15:52:44 +02:00
parent e50f941b79
commit e6cd4038e2
2 changed files with 2 additions and 3 deletions

View File

@ -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));
int insn = INVOKEVIRTUAL;
if (call.isInterface()) insn = INVOKEINTERFACE;
else if (call.isStatic()) insn = INVOKESTATIC;
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;
mv.visitMethodInsn(insn, call.owner().getInternalName(), call.name(), descriptor, call.isInterface());

View File

@ -1034,7 +1034,6 @@ public class TestComplete {
}
@Test
//@Ignore("This hangs")
public void testBug309() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug309.jav");
var clazz = classFiles.get("Bug309");