diff options
author | David Feuer <david.feuer@gmail.com> | 2017-03-01 01:14:13 -0500 |
---|---|---|
committer | David Feuer <David.Feuer@gmail.com> | 2017-03-01 01:14:14 -0500 |
commit | 701256df88c61a2eee4cf00a59e61ef76a57b4b4 (patch) | |
tree | 390d51339bff6fb8d5369ec55a7d3cdc2fb5bb57 /compiler | |
parent | b86d226fda2f512178e04da4dec96b15c4480507 (diff) | |
download | haskell-701256df88c61a2eee4cf00a59e61ef76a57b4b4.tar.gz |
Change catch# demand signature
* Give `catch#` a lazy demand signature, to make it more honest.
* Make `catchException` and `catchAny` force their arguments so they
actually behave as advertised.
* Use `catch` rather than `catchException` in `forkIO`, `forkOn`, and
`forkOS` to avoid losing exceptions.
Fixes #13330
Reviewers: rwbarton, simonpj, simonmar, bgamari, hvr, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3244
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/basicTypes/Demand.hs | 2 | ||||
-rw-r--r-- | compiler/prelude/primops.txt.pp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 71a044f51f..eab01d0605 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -708,7 +708,7 @@ lazyApply1Dmd, lazyApply2Dmd, strictApply1Dmd, catchArgDmd :: Demand strictApply1Dmd = JD { sd = Str VanStr (SCall HeadStr) , ud = Use Many (UCall One Used) } --- First argument of catch#: +-- First argument of catchRetry# and catchSTM#: -- uses its arg once, applies it once -- and catches exceptions (the ExnStr) part catchArgDmd = JD { sd = Str ExnStr (SCall HeadStr) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index f1ee3b36b0..855bdfcb62 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -1965,7 +1965,7 @@ primop CatchOp "catch#" GenPrimOp -> State# RealWorld -> (# State# RealWorld, a #) with - strictness = { \ _arity -> mkClosedStrictSig [ catchArgDmd + strictness = { \ _arity -> mkClosedStrictSig [ lazyApply1Dmd , lazyApply2Dmd , topDmd] topRes } -- See Note [Strictness for mask/unmask/catch] |