[project @ 2005-05-19 07:58:35 by simonpj]
authorsimonpj <unknown>
Thu, 19 May 2005 07:58:36 +0000 (07:58 +0000)
committersimonpj <unknown>
Thu, 19 May 2005 07:58:36 +0000 (07:58 +0000)
commitf7ccc07816e862902d217ec37a6bcff5889b786c
treed9ecd39bed6038582fadeb357e0746b6596a74ef
parentead9311db6e098b3affdc552269ea52bad8c12b5
[project @ 2005-05-19 07:58:35 by simonpj]
Catch an exception in Template Haskell code

Merge to STABLE

If the code run by a Template Haskell splice fails with, say,
a pattern-match failure, we should not report it as a GHC panic.
It's a bug in the user's program.

This commit fixes up the exception handling to do the right thing.

Fixes SourceForge item #1201666

TH_fail tests it.
ghc/compiler/nativeGen/MachCodeGen.hs
ghc/compiler/nativeGen/MachRegs.lhs
ghc/compiler/nativeGen/RegisterAlloc.hs
ghc/compiler/typecheck/TcSplice.lhs
ghc/compiler/utils/IOEnv.hs
ghc/compiler/utils/Panic.lhs