[Git][ghc/ghc][wip/exception-propagate] 2 commits: fix order of arguments
Matthew Pickering (@mpickering)
gitlab at gitlab.haskell.org
Wed Sep 4 16:24:49 UTC 2024
Matthew Pickering pushed to branch wip/exception-propagate at Glasgow Haskell Compiler / GHC
Commits:
5a07a053 by Matthew Pickering at 2024-09-04T17:20:04+01:00
fix order of arguments
- - - - -
b47b517b by Matthew Pickering at 2024-09-04T17:24:37+01:00
pointers
- - - - -
3 changed files:
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Imp.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/FD.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
Changes:
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Imp.hs
=====================================
@@ -55,6 +55,7 @@ fixST k = unsafeIOToST $ do
m <- newEmptyMVar
ans <- unsafeDupableInterleaveIO
(readMVar m `catch` \BlockedIndefinitelyOnMVar ->
+ -- TODO, should this propagate the error?
throwIO NonTermination)
result <- unsafeSTToIO (k ans)
putMVar m result
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Handle/FD.hs
=====================================
@@ -123,7 +123,7 @@ addFilePathToIOError fun fp ioe
catchAndAnnotate :: FilePath -> String -> IO a -> IO a
catchAndAnnotate fp s a =
catchExceptionNoPropagate @IOError a
- (\(ExceptionWithContext c e) -> rethrowIO (ExceptionWithContext c (addFilePathToIOError fp s e)))
+ (\(ExceptionWithContext c e) -> rethrowIO (ExceptionWithContext c (addFilePathToIOError s fp e)))
-- | Specialised 'rethrowIO' to 'IOError', helpful for type inference
rethrowError :: ExceptionWithContext IOError -> IO a
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
=====================================
@@ -184,6 +184,7 @@ do_operation fun h act m = do
putMVar m h_
case () of
_ | Just ioe <- fromException e ->
+ -- TODO: Stop this adding a callstack
ioError (augmentIOError ioe fun h)
_ | Just async_ex <- fromException e -> do -- see Note [async]
let _ = async_ex :: SomeAsyncException
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bcc33162465ea3cace930668887ac59f0f6aa9f0...b47b517b4ae17cca113c3462e79708a58941a012
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bcc33162465ea3cace930668887ac59f0f6aa9f0...b47b517b4ae17cca113c3462e79708a58941a012
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240904/c741d1c3/attachment-0001.html>
More information about the ghc-commits
mailing list