X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FHscMain.lhs;h=93ad614a58a53f009f607068996c0f4a100506e7;hb=781fd68db0abe2ebca2481a149442ee3ff8d99b7;hp=76c35ea1e6d0fbd95597db649fe95df242b9f583;hpb=de1a1f9f882cf1a5c81c4a152edc001aafd3f8a3;p=ghc-hetmet.git diff --git a/compiler/main/HscMain.lhs b/compiler/main/HscMain.lhs index 76c35ea..93ad614 100644 --- a/compiler/main/HscMain.lhs +++ b/compiler/main/HscMain.lhs @@ -54,6 +54,7 @@ import DsMeta ( templateHaskellNames ) import SrcLoc ( SrcSpan, noSrcLoc, interactiveSrcLoc, srcLocSpan, noSrcSpan, unLoc ) import VarSet import VarEnv ( emptyTidyEnv ) +import Panic #endif import Id ( Id ) @@ -186,7 +187,7 @@ hscParse mod_summary = do let loc = mkSrcLoc (mkFastString src_filename) 1 1 - case unP parseModule (mkPState buf loc dflags) of + case unP parseModule (mkPState dflags buf loc) of PFailed span err -> throwOneError (mkPlainErrMsg span err) @@ -996,7 +997,7 @@ hscParseThing parser dflags str let loc = mkSrcLoc (fsLit "") 1 1 - case unP parser (mkPState buf loc dflags) of + case unP parser (mkPState dflags buf loc) of PFailed span err -> do let msg = mkPlainErrMsg span err @@ -1026,6 +1027,11 @@ hscParseThing parser dflags str compileExpr :: HscEnv -> SrcSpan -> CoreExpr -> IO HValue compileExpr hsc_env srcspan ds_expr + | rtsIsProfiled + = throwIO (InstallationError "You can't call compileExpr in a profiled compiler") + -- Otherwise you get a seg-fault when you run it + + | otherwise = do { let { dflags = hsc_dflags hsc_env ; lint_on = dopt Opt_DoCoreLinting dflags }