X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FInteractiveEval.hs;h=9fe7504163ca48feee0257f4f0d06f3f503d320a;hb=5892af0e08fdb890b5a0b9a64346d9f7773a6ed8;hp=e5d91c930cc9b3988ee16393093945c5de8f39fe;hpb=decbb181cf7a06c6135ca451307a7e7214385f2e;p=ghc-hetmet.git diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index e5d91c9..9fe7504 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -350,32 +350,13 @@ sandboxIO dflags statusMVar thing = -- not "Interrupted", we unset the exception flag before throwing. -- rethrow :: DynFlags -> IO a -> IO a -#if __GLASGOW_HASKELL__ < 609 -rethrow dflags io = Exception.catch io $ \e -> do -- NB. not catchDyn - case e of - -- If -fbreak-on-error, we break unconditionally, - -- but with care of not breaking twice - _ | dopt Opt_BreakOnError dflags && - not(dopt Opt_BreakOnException dflags) - -> poke exceptionFlag 1 - - -- If it is an "Interrupted" exception, we allow - -- a possible break by way of -fbreak-on-exception - DynException d | Just Interrupted <- fromDynamic d - -> return () - - -- In any other case, we don't want to break - _ -> poke exceptionFlag 0 - - Exception.throwIO e -#else -rethrow dflags io = Exception.catch io $ \se@(SomeException e) -> do +rethrow dflags io = Exception.catch io $ \se -> do -- If -fbreak-on-error, we break unconditionally, -- but with care of not breaking twice if dopt Opt_BreakOnError dflags && not (dopt Opt_BreakOnException dflags) then poke exceptionFlag 1 - else case cast e of + else case fromException se of -- If it is an "Interrupted" exception, we allow -- a possible break by way of -fbreak-on-exception Just Interrupted -> return () @@ -383,7 +364,6 @@ rethrow dflags io = Exception.catch io $ \se@(SomeException e) -> do _ -> poke exceptionFlag 0 Exception.throwIO se -#endif withInterruptsSentTo :: ThreadId -> IO r -> IO r withInterruptsSentTo thread get_result = do