[commit: ghc] ghc-8.0: DynFlags: Don't panic on incompatible Safe Haskell flags (ad6a7a3)
git at git.haskell.org
git at git.haskell.org
Thu Feb 18 12:02:35 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/ad6a7a3c65e6083417230521e28cb3ed831bf184/ghc
>---------------------------------------------------------------
commit ad6a7a3c65e6083417230521e28cb3ed831bf184
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
(cherry picked from commit 2b906af0dab01c30c28792d39161e01449b85cb0)
>---------------------------------------------------------------
ad6a7a3c65e6083417230521e28cb3ed831bf184
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 d280f02..c02e0d3 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1882,7 +1882,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