summaryrefslogtreecommitdiff
path: root/compiler/GHC/Data/FastString.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Data/FastString.hs')
-rw-r--r--compiler/GHC/Data/FastString.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Data/FastString.hs b/compiler/GHC/Data/FastString.hs
index d9363fe2e4..1388563ca7 100644
--- a/compiler/GHC/Data/FastString.hs
+++ b/compiler/GHC/Data/FastString.hs
@@ -566,7 +566,11 @@ hashStr sbs@(SBS.SBS ba#) = loop 0# 0#
-- DO NOT move this let binding! indexCharOffAddr# reads from the
-- pointer so we need to evaluate this based on the length check
-- above. Not doing this right caused #17909.
+#if __GLASGOW_HASKELL__ >= 901
+ !c = int8ToInt# (indexInt8Array# ba# n)
+#else
!c = indexInt8Array# ba# n
+#endif
!h2 = (h *# 16777619#) `xorI#` c
in
loop h2 (n +# 1#)