Skip to content

Commit

Permalink
fix: FCMPG/L should not treat args as wide types
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Jan 27, 2024
1 parent d46f3af commit 4daaeef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ public void execute(SimpleInstruction instruction) {
}
}
case FCMPL -> {
Value value1 = frame.pop2();
Value value2 = frame.pop2();
Value value1 = frame.pop();
Value value2 = frame.pop();
if (value1 instanceof Value.KnownFloatValue float1 && value2 instanceof Value.KnownFloatValue float2) {
float a = float1.value();
float b = float2.value();
Expand All @@ -217,8 +217,8 @@ public void execute(SimpleInstruction instruction) {
}
}
case FCMPG -> {
Value value1 = frame.pop2();
Value value2 = frame.pop2();
Value value1 = frame.pop();
Value value2 = frame.pop();
if (value1 instanceof Value.KnownFloatValue float1 && value2 instanceof Value.KnownFloatValue float2) {
float a = float1.value();
float b = float2.value();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.super java/lang/Object
.class public super Example {
.method public exampleMethod ()I {
parameters: { this },
code: {
A:
ldc 1.25F
ldc 5.55F
fcmpg
ldc 1.25F
ldc 5.55F
fcmpl
iadd
ireturn
B:
}
}
}

0 comments on commit 4daaeef

Please sign in to comment.