eliminate a crash when trying to use :break on a compiled module (test: break007)
authorSimon Marlow <simonmar@microsoft.com>
Wed, 9 May 2007 13:24:24 +0000 (13:24 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 9 May 2007 13:24:24 +0000 (13:24 +0000)
compiler/ghci/InteractiveUI.hs

index 4fb1ad3..5f9f74f 100644 (file)
@@ -1793,7 +1793,7 @@ mkTickArray ticks
         [ (line, (nm,span)) | (nm,span) <- ticks,
                               line <- srcSpanLines span ]
     where
-        max_line = maximum (map GHC.srcSpanEndLine (map snd ticks))
+        max_line = foldr max 0 (map GHC.srcSpanEndLine (map snd ticks))
         srcSpanLines span = [ GHC.srcSpanStartLine span .. 
                               GHC.srcSpanEndLine span ]