Skip to content

Commit

Permalink
[libc] Fix forward constexpr add_with_carry / sub_with_borrow
Browse files Browse the repository at this point in the history
Introduced in #87613.
  • Loading branch information
gchatelet committed Apr 4, 2024
1 parent 7bd163d commit 8ae9c62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libc/src/__support/math_extras.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ add_with_carry(T a, T b, T carry_in, T &carry_out) {
RETURN_IF(unsigned long long, __builtin_addcll)
#endif
}
T sum;
T sum = {};
T carry1 = add_overflow(a, b, sum);
T carry2 = add_overflow(sum, carry_in, sum);
carry_out = carry1 | carry2;
Expand All @@ -112,7 +112,7 @@ sub_with_borrow(T a, T b, T carry_in, T &carry_out) {
RETURN_IF(unsigned long long, __builtin_subcll)
#endif
}
T sub;
T sub = {};
T carry1 = sub_overflow(a, b, sub);
T carry2 = sub_overflow(sub, carry_in, sub);
carry_out = carry1 | carry2;
Expand Down

0 comments on commit 8ae9c62

Please sign in to comment.