diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-10-09 21:38:11 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-10-09 21:38:19 -0700 |
commit | 2f639ffe09dd24d8648363b567de2d7caa39db99 (patch) | |
tree | e9d20f284903563cbdfed76c76ca976d0474b69d | |
parent | a65d2131647e010608d2a1956116a0012946838f (diff) |
Fix use-after-close lazy IO bug
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.
Signed-off-by: David Feuer <David.Feuer@gmail.com>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
-rw-r--r-- | src/Haddock.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Haddock.hs b/src/Haddock.hs index 980926cd..c0a6714b 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -451,7 +451,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" |