[commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix improper lazy IO use (9680079)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:31:36 UTC 2015


Repository : ssh://git@git.haskell.org/haddock

On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot
Link       : http://git.haskell.org/haddock.git/commitdiff/968007937c3e108150a109c12163bbeff978629a

>---------------------------------------------------------------

commit 968007937c3e108150a109c12163bbeff978629a
Author: treeowl <David.Feuer at gmail.com>
Date:   Thu Oct 9 20:07:36 2014 -0400

    Fix improper lazy IO use
    
    Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results.


>---------------------------------------------------------------

968007937c3e108150a109c12163bbeff978629a
 haddock-api/src/Haddock.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 0cff5bd..631f813 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -456,7 +456,7 @@ getPrologue dflags flags =
     [filename] -> withFile filename ReadMode $ \h -> do
       hSetEncoding h utf8
       str <- hGetContents h
-      return . Just $ parseParas dflags str
+      return . Just $! parseParas dflags str
     _ -> throwE "multiple -p/--prologue options"
 
 



More information about the ghc-commits mailing list