Fix a bug in the handling of nested orElse
authorSimon Marlow <marlowsd@gmail.com>
Mon, 10 Dec 2012 12:00:54 +0000 (12:00 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 10 Dec 2012 12:00:54 +0000 (12:00 +0000)
commitf184d9caffa09750ef6a374a7987b9213d6db28e
treebfc6240b4f9220400769846bdade3dc9abfb53b0
parent332e68122d578fbc09f49b61a628217a60a70877
Fix a bug in the handling of nested orElse

Exposed by the following snippet, courtesy of Bas van Dijk and Patrick
Palka on libraries@haskell.org:

import Control.Concurrent.STM
main = do
  x <- atomically $ do
         t <- newTVar 1
         writeTVar t 2
         ((readTVar t >> retry) `orElse` return ()) `orElse` return ()
         readTVar t
  print x
rts/STM.c