mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Correctly compile subChecked for Dec
This commit is contained in:
parent
b3966a588a
commit
25f3190d33
2 changed files with 20 additions and 5 deletions
|
@ -1965,7 +1965,10 @@ fn build_dec_binop<'a, 'ctx>(
|
|||
let val = dec_binop_with_overflow(env, bitcode::DEC_ADD_WITH_OVERFLOW, lhs, rhs);
|
||||
cast_with_overflow_dec_to_roc_type(env, layout_interner, val.into(), return_layout)
|
||||
}
|
||||
NumSubChecked => call_bitcode_fn(env, &[lhs, rhs], bitcode::DEC_SUB_WITH_OVERFLOW),
|
||||
NumSubChecked => {
|
||||
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),
|
||||
NumAdd => build_dec_binop_throw_on_overflow(
|
||||
env,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue