Skip to content

Commit

Permalink
Fixed SourceVersionCommand.
Browse files Browse the repository at this point in the history
  • Loading branch information
dirtyhabits97 committed Apr 22, 2024
1 parent f1f73b4 commit b7749b3
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ public extension SourceVersionCommand {

// uint64_t version; /* A.B.C.D.E packed as a24.b10.c10.d10.e10 */
var version: SourceVersion {
let mask: UInt64 = 0b1111
// In order to get B through E, we need a 10bit mask
let mask: UInt64 = 0b11_1111_1111
return (
Int(underlyingValue.version << 40),
Int(underlyingValue.version << 30 & mask),
Int(underlyingValue.version << 20 & mask),
Int(underlyingValue.version << 10 & mask),
Int(underlyingValue.version >> 40),
Int(underlyingValue.version >> 30 & mask),
Int(underlyingValue.version >> 20 & mask),
Int(underlyingValue.version >> 10 & mask),
Int(underlyingValue.version & mask)
)
}
Expand Down

0 comments on commit b7749b3

Please sign in to comment.