[commit: ghc] master: Likely fix to uninitialized DynFlags in plugins. (66fa188)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/66fa1886769c9e4b7aec4d278a797538a6220ced

>---------------------------------------------------------------

commit 66fa1886769c9e4b7aec4d278a797538a6220ced
Author: Daniel Vainsencher <[email protected]>
Date:   Thu Dec 13 18:19:43 2012 +0000

    Likely fix to uninitialized DynFlags in plugins.

>---------------------------------------------------------------

 compiler/simplCore/CoreMonad.lhs |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/compiler/simplCore/CoreMonad.lhs b/compiler/simplCore/CoreMonad.lhs
index c2c2650..5726cf5 100644
--- a/compiler/simplCore/CoreMonad.lhs
+++ b/compiler/simplCore/CoreMonad.lhs
@@ -922,8 +922,11 @@ argument to the plugin function so that we can turn this function into
 reinitializeGlobals :: CoreM ()
 reinitializeGlobals = do
     (sf_globals, linker_globals) <- read cr_globals
+    hsc_env <- getHscEnv
+    let dflags = hsc_dflags hsc_env
     liftIO $ restoreStaticFlagGlobals sf_globals
     liftIO $ restoreLinkerGlobals linker_globals
+    liftIO $ setUnsafeGlobalDynFlags dflags
 \end{code}
 
 %************************************************************************
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.