From eb8117f959ee0e109dbb8a9b500bcac2eb7871dc Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 27 Jan 2010 11:32:05 +0000 Subject: [PATCH] addCoverageTicksToBinds: tolerate a non-existent .hs file (#3803) --- compiler/deSugar/Coverage.lhs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs index b161a21..52c0f04 100644 --- a/compiler/deSugar/Coverage.lhs +++ b/compiler/deSugar/Coverage.lhs @@ -52,12 +52,10 @@ addCoverageTicksToBinds -> LHsBinds Id -> IO (LHsBinds Id, HpcInfo, ModBreaks) -addCoverageTicksToBinds dflags mod mod_loc tyCons binds = do - - let orig_file = - case ml_hs_file mod_loc of - Just file -> file - Nothing -> panic "can not find the original file during hpc trans" +addCoverageTicksToBinds dflags mod mod_loc tyCons binds = + case ml_hs_file mod_loc of + Nothing -> return (binds, emptyHpcInfo False, emptyModBreaks) + Just orig_file -> do if "boot" `isSuffixOf` orig_file then return (binds, emptyHpcInfo False, emptyModBreaks) else do -- 1.7.10.4