Skip to content

Commit 5e746af

Browse files
Merge pull request #228 from llvm-swift/bitwise-madness
[Size] Fix inverted bitwise operations
2 parents f2caa21 + 2152a11 commit 5e746af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/LLVM/Units.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ extension Size: UnsignedInteger {
261261
}
262262

263263
public static func |= (lhs: inout Size, rhs: Size) {
264-
lhs = Size(lhs.rawValue & rhs.rawValue)
264+
lhs = Size(lhs.rawValue | rhs.rawValue)
265265
}
266266

267267
public static func ^= (lhs: inout Size, rhs: Size) {
@@ -273,7 +273,7 @@ extension Size: UnsignedInteger {
273273
}
274274

275275
public static func <<= <RHS: BinaryInteger>(lhs: inout Size, rhs: RHS) {
276-
lhs = Size(lhs.rawValue >> rhs)
276+
lhs = Size(lhs.rawValue << rhs)
277277
}
278278

279279
public static prefix func ~ (x: Size) -> Size {

0 commit comments

Comments
 (0)