[project @ 1997-09-25 00:11:46 by sof]
authorsof <unknown>
Thu, 25 Sep 1997 00:11:46 +0000 (00:11 +0000)
committersof <unknown>
Thu, 25 Sep 1997 00:11:46 +0000 (00:11 +0000)
freeze{Float,Double}Array: state token not threaded properly

ghc/lib/ghc/ArrBase.lhs

index 0a65a3c..cee229d 100644 (file)
@@ -561,7 +561,7 @@ freezeFloatArray (MutableByteArray ixs arr#) = ST $ \ (S# s#) ->
          | otherwise
            = case (readFloatArray#  from# cur#     s#)  of { StateAndFloat# s1# ele ->
              case (writeFloatArray# to#   cur# ele s1#) of { s2# ->
-             copy (cur# +# 1#) from# to# s1#
+             copy (cur# +# 1#) from# to# s2#
              }}
 
 freezeDoubleArray (MutableByteArray ixs arr#) = ST $ \ (S# s#) ->
@@ -591,7 +591,7 @@ freezeDoubleArray (MutableByteArray ixs arr#) = ST $ \ (S# s#) ->
          | otherwise
            = case (readDoubleArray#  from# cur#     s#)  of { StateAndDouble# s1# ele ->
              case (writeDoubleArray# to#   cur# ele s1#) of { s2# ->
-             copy (cur# +# 1#) end# from# to# s1#
+             copy (cur# +# 1#) end# from# to# s2#
              }}
 
 unsafeFreezeArray     :: Ix ix => MutableArray s ix elt -> ST s (Array ix elt)