Skip to content

Commit

Permalink
Don't silently truncate blocks when encountering EVENT_DATA_END
Browse files Browse the repository at this point in the history
Blocks should never contain these, getEventBlock should simply run out
of data instead. It's less surprising to fail here.
  • Loading branch information
scpmw committed Oct 12, 2012
1 parent 85dbf28 commit 3bdd321
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GHC/RTS/Events.hs
Expand Up @@ -631,7 +631,9 @@ getEventBlock parsers = do
if b then return [] else do
mb_e <- getEvent parsers
case mb_e of
Nothing -> return []
-- This is almost certainly a data corruption. Just silently
-- truncating the block is probably not a good idea.
Nothing -> fail "Unexpected data end marker inside block!"
Just e -> do
es <- getEventBlock parsers
return (e:es)
Expand Down

0 comments on commit 3bdd321

Please sign in to comment.