[commit: ghc] master: DynFlags: Don't panic on incompatible Safe Haskell flags (2b906af)

git at git.haskell.org git at git.haskell.org
Tue Feb 16 22:13:36 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2b906af0dab01c30c28792d39161e01449b85cb0/ghc

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

commit 2b906af0dab01c30c28792d39161e01449b85cb0
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Feb 16 22:45:57 2016 +0100

    DynFlags: Don't panic on incompatible Safe Haskell flags
    
    We just return an arbitrary value since we are destined to fail due to
    the error anyways.
    
    Fixes #11580.
    
    Test Plan: Needs to be tested
    
    Reviewers: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1925
    
    GHC Trac Issues: #11580


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

2b906af0dab01c30c28792d39161e01449b85cb0
 compiler/main/DynFlags.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 6460b16..52da300 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1886,7 +1886,7 @@ combineSafeFlags :: SafeHaskellMode -> SafeHaskellMode -> DynP SafeHaskellMode
 combineSafeFlags a b | a == Sf_None         = return b
                      | b == Sf_None         = return a
                      | a == b               = return a
-                     | otherwise            = addErr errm >> return (panic errm)
+                     | otherwise            = addErr errm >> pure a
     where errm = "Incompatible Safe Haskell flags! ("
                     ++ show a ++ ", " ++ show b ++ ")"
 



More information about the ghc-commits mailing list