X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FClosureInfo.lhs;h=0620099ac7bbe870aecbd8dd3255647c4dfd165c;hb=aedb94f5f220b5e442b23ecc445fd38c8d9b6ba0;hp=df32299c2a4e3065bc9f1f62803b6b58bd9af748;hpb=176fa33f17dd78355cc572e006d2ab26898e2c69;p=ghc-hetmet.git diff --git a/compiler/codeGen/ClosureInfo.lhs b/compiler/codeGen/ClosureInfo.lhs index df32299..0620099 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,