Ticket #7110 (closed bug: duplicate)
Stack overflow when compiling with optimizations
Description
This program:
import Control.Exception (evaluate)
main :: IO ()
main = do
let smap = concat . replicate 300 $ concat [" ", replicate 2027 '#', " \n"]
evaluate $ fst (stringReader 1 smap)
stringReader :: Int -> String -> ((), String)
stringReader 1 ('\r':'\n':_) = ((), "")
stringReader _ ('\n':cs) = stringReader 1 cs -- unix
stringReader x (_:cs) = stringReader x cs
stringReader _ _ = ((), "")
Causes a stack overflow when compiled with -O2, and no problem when compiled without optimizations.
Change History
Note: See
TracTickets for help on using
tickets.
