diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-08-07 07:56:28 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-08-07 09:55:18 +0100 |
commit | 0957a9b0e3f9723761d12d9684c93209a8056755 (patch) | |
tree | 30df369f7cd5f7dd2db6481f01e97bfe7496ad60 /compiler/prelude/primops.txt.pp | |
parent | 8367f062785cd30d7ab6dfc52c0aa4d5a9a941fd (diff) | |
download | haskell-0957a9b0e3f9723761d12d9684c93209a8056755.tar.gz |
Add has_side_effets to the raise# primop
According to the definition of has_side_effets in PrimOp,
raise# clearly has side effects! In practice it makes little
difference becuase the fact that it returns bottom is more
important... but still it's better to say it right.
Diffstat (limited to 'compiler/prelude/primops.txt.pp')
-rw-r--r-- | compiler/prelude/primops.txt.pp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 4faa585246..19cd8127e5 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -1881,6 +1881,11 @@ primop RaiseOp "raise#" GenPrimOp strictness = { \ _arity -> mkClosedStrictSig [topDmd] botRes } -- NB: result is bottom out_of_line = True + has_side_effects = True + -- raise# certainly throws a Haskell exception and hence has_side_effects + -- It doesn't actually make much difference because the fact that it + -- returns bottom independently ensures that we are careful not to discard + -- it. But still, it's better to say the Right Thing. -- raiseIO# needs to be a primop, because exceptions in the IO monad -- must be *precise* - we don't want the strictness analyser turning |