Commit ee262071 authored by Simon Marlow's avatar Simon Marlow
Browse files

Force the result of user-defined commands

so that exceptions are reported with "*** Exception" instead of as a panic.
parent 57217f68
......@@ -1030,6 +1030,9 @@ defineMacro overwrite s = do
runMacro :: GHC.HValue{-String -> IO String-} -> String -> GHCi Bool
runMacro fun s = do
str <- io ((unsafeCoerce# fun :: String -> IO String) s)
-- make sure we force any exceptions in the result, while we are still
-- inside the exception handler for commands:
seqList str (return ())
enqueueCommands (lines str)
return False
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment