Skip to content

Commit

Permalink
Fix for indexInt8OffAddr# returning sized type in next GHC
Browse files Browse the repository at this point in the history
Include type signature to `toInt` for sake of quite old GHCs.
  • Loading branch information
Ericson2314 committed Jan 26, 2021
1 parent e3253fc commit 9b5b4a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion containers/src/Data/IntSet/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ import Text.Read

#if __GLASGOW_HASKELL__
import qualified GHC.Exts
import qualified GHC.Int
#endif

import qualified Data.Foldable as Foldable
Expand Down Expand Up @@ -1642,7 +1643,7 @@ highestBitSet x = WORD_SIZE_IN_BITS - 1 - countLeadingZeros x
----------------------------------------------------------------------}

indexOfTheOnlyBit bitmask =
GHC.Exts.I# (lsbArray `GHC.Exts.indexInt8OffAddr#` unboxInt (intFromNat ((bitmask * magic) `shiftRL` offset)))
fromIntegral (GHC.Int.I8# (lsbArray `GHC.Exts.indexInt8OffAddr#` unboxInt (intFromNat ((bitmask * magic) `shiftRL` offset))))
where unboxInt (GHC.Exts.I# i) = i
#if WORD_SIZE_IN_BITS==32
magic = 0x077CB531
Expand Down

0 comments on commit 9b5b4a9

Please sign in to comment.