Harden fixST
authorDavid Feuer <david.feuer@gmail.com>
Sat, 21 Jul 2018 19:45:35 +0000 (15:45 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 31 Jul 2018 19:53:19 +0000 (15:53 -0400)
commit39ab54c969fa5ca58392f039aa8f790932b9257a
tree12bb2df5dce973d432d578857dee362ce684ec96
parent9a4ac7567835c4ddf90d44500d4be7ddcaef4334
Harden fixST

Trac #15349 reveals that lazy blackholing can cause trouble for
`fixST` much like it can for `fixIO`. Make `fixST` work just
like `fixIO`.

Reviewers: simonmar, hvr, bgamari

Reviewed By: simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15349

Differential Revision: https://phabricator.haskell.org/D4948

(cherry picked from commit 5a49651f3161473b383ec497af38e9daa022b9ac)
libraries/base/Control/Monad/Fix.hs
libraries/base/Control/Monad/ST/Imp.hs
libraries/base/GHC/ST.hs
libraries/base/tests/T15349.hs [new file with mode: 0644]
libraries/base/tests/T15349.stderr [new file with mode: 0644]
libraries/base/tests/all.T