summaryrefslogtreecommitdiff
path: root/ghc/compiler/utils/FastString.lhs
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-08-20 12:55:14 +0000
committersimonmar <unknown>2003-08-20 12:55:14 +0000
commitaffe92132329afa642bc83d74d5b07d14187e968 (patch)
tree8c0ff12754b2a07bb9ab7a0e44687c0920e4f299 /ghc/compiler/utils/FastString.lhs
parent007ad2be2af3375088b3ec774578cc6a1d218ff6 (diff)
downloadhaskell-affe92132329afa642bc83d74d5b07d14187e968.tar.gz
[project @ 2003-08-20 12:55:14 by simonmar]
Fix bug in hashSubStringBA, which it appears has been broken for ever. However, I suspect so far we've never tickled the bug in GHC.
Diffstat (limited to 'ghc/compiler/utils/FastString.lhs')
-rw-r--r--ghc/compiler/utils/FastString.lhs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ghc/compiler/utils/FastString.lhs b/ghc/compiler/utils/FastString.lhs
index 494648f34c..61750aabdb 100644
--- a/ghc/compiler/utils/FastString.lhs
+++ b/ghc/compiler/utils/FastString.lhs
@@ -391,9 +391,9 @@ hashSubStrBA ba# start# len# =
2# -> ((ord# c0 *# 631#) +# (ord# c1 *# 217#) +# len#) `remInt#` hASH_TBL_SIZE#
_ -> ((ord# c0 *# 631#) +# (ord# c1 *# 217#) +# (ord# c2 *# 43#) +# len#) `remInt#` hASH_TBL_SIZE#
where
- c0 = indexCharArray# ba# 0#
- c1 = indexCharArray# ba# (len# `quotInt#` 2# -# 1#)
- c2 = indexCharArray# ba# (len# -# 1#)
+ c0 = indexCharArray# ba# (start# +# 0#)
+ c1 = indexCharArray# ba# (start# +# (len# `quotInt#` 2# -# 1#))
+ c2 = indexCharArray# ba# (start# +# (len# -# 1#))
-- c1 = indexCharArray# ba# 1#
-- c2 = indexCharArray# ba# 2#