Skip to content

Commit

Permalink
fix: use type cast for comparing BinaryOp to -1 (AssemblyScript#1964)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Wyndham authored Jul 23, 2021
1 parent 5df7318 commit 20a0635
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/builtins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 20a0635

Please sign in to comment.