Skip to content

Commit 919397c

Browse files
committed
Follow up to #6722: make dead code consistent in handling NaN
The two branches are currently dead code, as we never call `genCZJUMP` with tk = DOUBLE or FLOAT. However, in case the two branches become reachable, it's good to make the logic consistent as in `genCJUMP` (#6722).
1 parent b5a6963 commit 919397c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,12 +1267,12 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
12671267
emit(asm.Opcodes.LCMP)
12681268
case FLOAT =>
12691269
emit(asm.Opcodes.FCONST_0)
1270-
if (op == LT || op == LE) emit(asm.Opcodes.FCMPG)
1271-
else emit(asm.Opcodes.FCMPL)
1270+
if (op == LT || op == LE) emit(asm.Opcodes.FCMPL)
1271+
else emit(asm.Opcodes.FCMPG)
12721272
case DOUBLE =>
12731273
emit(asm.Opcodes.DCONST_0)
1274-
if (op == LT || op == LE) emit(asm.Opcodes.DCMPG)
1275-
else emit(asm.Opcodes.DCMPL)
1274+
if (op == LT || op == LE) emit(asm.Opcodes.DCMPL)
1275+
else emit(asm.Opcodes.DCMPG)
12761276
}
12771277
bc.emitIF(op, success)
12781278
}

0 commit comments

Comments
 (0)