Skip to content

Commit e28ad90

Browse files
committed
math.big: mul functions now indicate overflow
1 parent 1cab18f commit e28ad90

File tree

4 files changed

+185
-53
lines changed

4 files changed

+185
-53
lines changed

lib/compiler/aro/aro/Value.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ pub fn div(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b
695695
);
696696
defer comp.gpa.free(limbs_buffer);
697697

698-
result_q.divTrunc(&result_r, lhs_bigint, rhs_bigint, limbs_buffer);
698+
result_q.divTrunc(&result_r, lhs_bigint, rhs_bigint, limbs_buffer, null);
699699

700700
res.* = try intern(comp, .{ .int = .{ .big_int = result_q.toConst() } });
701701
return !result_q.toConst().fitsInTwosComp(ty.signedness(comp), bits);
@@ -748,7 +748,7 @@ pub fn rem(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value {
748748
);
749749
defer comp.gpa.free(limbs_buffer);
750750

751-
result_q.divTrunc(&result_r, lhs_bigint, rhs_bigint, limbs_buffer);
751+
result_q.divTrunc(&result_r, lhs_bigint, rhs_bigint, limbs_buffer, null);
752752
return intern(comp, .{ .int = .{ .big_int = result_r.toConst() } });
753753
}
754754

0 commit comments

Comments
 (0)