summaryrefslogtreecommitdiff
path: root/compiler/codeGen/ClosureInfo.lhs
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2008-12-05 10:21:49 +0000
committersimonpj@microsoft.com <unknown>2008-12-05 10:21:49 +0000
commit93da88b3d688388a5ba2da32afd5c1948fb10929 (patch)
tree890dec1fd1fc7fc986d485b72d146ac200a01c74 /compiler/codeGen/ClosureInfo.lhs
parenta2fe6073155b0d056a257d8f860baf9816c2381e (diff)
downloadhaskell-93da88b3d688388a5ba2da32afd5c1948fb10929.tar.gz
Comments only (Note [Entering error thunks])
Diffstat (limited to 'compiler/codeGen/ClosureInfo.lhs')
-rw-r--r--compiler/codeGen/ClosureInfo.lhs24
1 files changed, 24 insertions, 0 deletions
diff --git a/compiler/codeGen/ClosureInfo.lhs b/compiler/codeGen/ClosureInfo.lhs
index df32299c2a..0620099ac7 100644
--- a/compiler/codeGen/ClosureInfo.lhs
+++ b/compiler/codeGen/ClosureInfo.lhs
@@ -728,6 +728,30 @@ staticClosureNeedsLink (ConInfo { closureSMRep = sm_rep, closureCon = con })
_other -> True
\end{code}
+Note [Entering error thunks]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Consider this
+
+ fail :: Int
+ fail = error Int "Urk"
+
+ foo :: Bool -> Bool
+ foo True y = (fail `cast` Bool -> Bool) y
+ foo False y = False
+
+This looks silly, but it can arise from case-of-error. Even if it
+does, we'd usually see that 'fail' is a bottoming function and would
+discard the extra argument 'y'. But even if that does not occur,
+this program is still OK. We will enter 'fail', which never returns.
+
+The WARN is just to alert me to the fact that we aren't spotting that
+'fail' is bottoming.
+
+(We are careful never to make a funtion value look like a data type,
+because we can't enter a function closure -- but that is not the
+problem here.)
+
+
Avoiding generating entries and info tables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At present, for every function we generate all of the following,