Skip to content

Commit b6b16bf

Browse files
scottmcmgitbot
authored and
gitbot
committed
Fix chaining carrying_adds
Something about the MIR lowering for `||` ended up breaking this, but it's fixed by changing the code to use `|` instead. I also added an assembly test to ensure it *keeps* being `adc`.
1 parent d50e5ba commit b6b16bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/num/uint_macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ macro_rules! uint_impl {
23542354
// to generate optimal code for now, and LLVM doesn't have an equivalent intrinsic
23552355
let (a, b) = self.overflowing_add(rhs);
23562356
let (c, d) = a.overflowing_add(carry as $SelfT);
2357-
(c, b || d)
2357+
(c, b | d)
23582358
}
23592359

23602360
/// Calculates `self` + `rhs` with a signed `rhs`.

0 commit comments

Comments
 (0)