From c175588b56d2db4f032efb4d0ff302b442bff373 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Fri, 9 Jul 2021 15:38:24 -0400 Subject: [PATCH] fix: use type cast for comparing BinaryOp to `-1` --- src/builtins.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtins.ts b/src/builtins.ts index 877d8ab7e2..79d7eb1d01 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -1541,7 +1541,7 @@ function builtin_max(ctx: BuiltinContext): ExpressionRef { case TypeKind.F32: return module.binary(BinaryOp.MaxF32, arg0, arg1); case TypeKind.F64: return module.binary(BinaryOp.MaxF64, arg0, arg1); } - if (op != -1) { + if (op as i32 != -1) { let flow = compiler.currentFlow; let typeRef = type.toRef(); let temp1 = flow.getTempLocal(type, findUsedLocals(arg1)); @@ -1620,7 +1620,7 @@ function builtin_min(ctx: BuiltinContext): ExpressionRef { case TypeKind.F32: return module.binary(BinaryOp.MinF32, arg0, arg1); case TypeKind.F64: return module.binary(BinaryOp.MinF64, arg0, arg1); } - if (op != -1) { + if (op as i32 != -1) { let flow = compiler.currentFlow; let typeRef = type.toRef(); let temp1 = flow.getTempLocal(type, findUsedLocals(arg1));