Skip to content

Commit

Permalink
feat(objectionary#540): all the integration tests are failed
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Oct 7, 2024
1 parent 01d1993 commit 58d5b7b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1656,13 +1656,13 @@ private enum Instruction {
visitor.visitInvokeDynamicInsn(
String.valueOf(arguments.get(0)),
String.valueOf(arguments.get(1)),
(Handle) arguments.get(2),
Handle.class.cast(arguments.get(2)),
arguments.subList(3, arguments.size()).toArray()
)
),

/**
* Create new object of type identified by class reference in constant pool index.
* Create a new object of a type identified by class reference in constant pool index.
*/
NEW(Opcodes.NEW, (visitor, arguments) ->
visitor.visitTypeInsn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,17 @@ void write(final CustomClassWriter visitor) {
try {
final MethodVisitor mvisitor = this.properties.writeMethod(
visitor,
this.maxs.compute()
// this.maxs.compute()
false
);
this.annotations.write(mvisitor);
this.defvalues.forEach(defvalue -> defvalue.writeTo(mvisitor));
if (!this.properties.isAbstract()) {
mvisitor.visitCode();
this.tryblocks.forEach(block -> block.writeTo(mvisitor));
this.instructions.forEach(instruction -> instruction.writeTo(mvisitor));
mvisitor.visitMaxs(this.maxs.stack(), this.maxs.locals());
// mvisitor.visitMaxs(this.maxs.stack(), this.maxs.locals());
mvisitor.visitMaxs(computeStack(), computeLocals());
}
mvisitor.visitEnd();
} catch (final NegativeArraySizeException exception) {
Expand Down
10 changes: 10 additions & 0 deletions src/test/resources/maxs/Maxs.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@ private static int staticMethod(int a, int b) {
return a - b;
}

private void ifstatement(int initial) {
if (initial > 10) {
long a = 42L * System.currentTimeMillis();
long b = 42L * System.currentTimeMillis();
System.out.println("Hello: " + a + b);
} else {
System.out.println("World");
}
}

// Inner class to add complexity
private class Inner {
public String partOne() {
Expand Down

0 comments on commit 58d5b7b

Please sign in to comment.