Fix #296
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 3m29s
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 3m29s
This commit is contained in:
parent
a1b5c0541b
commit
01e374eadd
11
resources/bytecode/javFiles/Bug296.jav
Normal file
11
resources/bytecode/javFiles/Bug296.jav
Normal file
@ -0,0 +1,11 @@
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug296 {
|
||||
public static m1() {
|
||||
return m2();
|
||||
}
|
||||
|
||||
static m2() {
|
||||
return 10;
|
||||
}
|
||||
}
|
@ -1008,6 +1008,7 @@ public class Codegen {
|
||||
break;
|
||||
}
|
||||
case TargetMethodCall call: {
|
||||
if (!call.isStatic())
|
||||
generate(state, call.expr());
|
||||
for (var i = 0; i < call.args().size(); i++) {
|
||||
var e = call.args().get(i);
|
||||
|
@ -940,4 +940,11 @@ public class TestComplete {
|
||||
var clazz = classFiles.get("Bug293");
|
||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug296() throws Exception {
|
||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug296.jav");
|
||||
var clazz = classFiles.get("Bug296");
|
||||
clazz.getDeclaredMethod("m1").invoke(null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user