From 0957a9b0e3f9723761d12d9684c93209a8056755 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Thu, 7 Aug 2014 07:56:28 +0100 Subject: 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. --- compiler/prelude/primops.txt.pp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/prelude/primops.txt.pp') 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 -- cgit v1.2.1