Skip to content

Commit

Permalink
fix: TeaVM analyzer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zlataovce committed Aug 20, 2024
1 parent 1502dfa commit a5efae1
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,27 @@ public Instruction create(Clazz clazz, CodeAttribute codeAttribute, int index) {
return replacementInstruction;
}

{
//noinspection ConstantValue - getClass never returns null, so the code never actually runs
if (this.getClass() == null) {
// make TeaVM aware of our overridden methods
// why does this need to happen? I have no idea
this.teaVMFix();
}
}

@SuppressWarnings("DataFlowIssue")
private void teaVMFix() {
this.visitSimpleInstruction(null, null, null, 0, null);
this.visitVariableInstruction(null, null, null, 0, null);
this.visitConstantInstruction(null, null, null, 0, null);
this.visitBranchInstruction(null, null, null, 0, null);
this.visitTableSwitchInstruction(null, null, null, 0, null);
this.visitLookUpSwitchInstruction(null, null, null, 0, null);
this.visitLabelInstruction(null, null, null, 0, null);
this.visitCatchInstruction(null, null, null, 0, null);
}

// Implementations for InstructionVisitor.

@Override
Expand Down

0 comments on commit a5efae1

Please sign in to comment.