Correctly compile mulChecked for Dec

This commit is contained in:
Ayaz Hafiz 2023-06-06 17:37:14 -05:00
parent 25f3190d33
commit 3a25ec5322
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 18 additions and 1 deletions

View file

@ -1969,7 +1969,10 @@ fn build_dec_binop<'a, 'ctx>(
let val = dec_binop_with_overflow(env, bitcode::DEC_SUB_WITH_OVERFLOW, lhs, rhs);
cast_with_overflow_dec_to_roc_type(env, layout_interner, val.into(), return_layout)
}
NumMulChecked => call_bitcode_fn(env, &[lhs, rhs], bitcode::DEC_MUL_WITH_OVERFLOW),
NumMulChecked => {
let val = dec_binop_with_overflow(env, bitcode::DEC_MUL_WITH_OVERFLOW, lhs, rhs);
cast_with_overflow_dec_to_roc_type(env, layout_interner, val.into(), return_layout)
}
NumAdd => build_dec_binop_throw_on_overflow(
env,
parent,