Skip to content

Commit 20a0635

Browse files
author
Willem Wyndham
authored
fix: use type cast for comparing BinaryOp to -1 (#1964)
1 parent 5df7318 commit 20a0635

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/builtins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ function builtin_max(ctx: BuiltinContext): ExpressionRef {
15411541
case TypeKind.F32: return module.binary(BinaryOp.MaxF32, arg0, arg1);
15421542
case TypeKind.F64: return module.binary(BinaryOp.MaxF64, arg0, arg1);
15431543
}
1544-
if (op != -1) {
1544+
if (op as i32 != -1) {
15451545
let flow = compiler.currentFlow;
15461546
let typeRef = type.toRef();
15471547
let temp1 = flow.getTempLocal(type, findUsedLocals(arg1));
@@ -1620,7 +1620,7 @@ function builtin_min(ctx: BuiltinContext): ExpressionRef {
16201620
case TypeKind.F32: return module.binary(BinaryOp.MinF32, arg0, arg1);
16211621
case TypeKind.F64: return module.binary(BinaryOp.MinF64, arg0, arg1);
16221622
}
1623-
if (op != -1) {
1623+
if (op as i32 != -1) {
16241624
let flow = compiler.currentFlow;
16251625
let typeRef = type.toRef();
16261626
let temp1 = flow.getTempLocal(type, findUsedLocals(arg1));

0 commit comments

Comments
 (0)