[commit: ghc] master: Dont call unsafeGlobalDynFlags if it is not set (5166ee9)
git at git.haskell.org
git at git.haskell.org
Mon Mar 16 17:39:36 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/5166ee94e439375a4e6acb80f88ec6ee65476bbd/ghc
>---------------------------------------------------------------
commit 5166ee94e439375a4e6acb80f88ec6ee65476bbd
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Mon Mar 16 18:36:59 2015 +0100
Dont call unsafeGlobalDynFlags if it is not set
Parsing of static and mode flags happens before any session is started,
i.e., before the first call to 'GHC.withGhc'. Therefore, to report
errors for invalid usage of these two types of flags, we can not call
any function that needs DynFlags, as there are no DynFlags available yet
(unsafeGlobalDynFlags is not set either). So we always print "on the
commandline" as the location, which is true except for Api users, which
is probably ok.
When reporting errors for invalid usage of dynamic flags we /can/ make
use of DynFlags, and we do so explicitly in
DynFlags.parseDynamicFlagsFull.
Before, we called unsafeGlobalDynFlags when an invalid (combination of)
flag(s) was given on the commandline, resulting in panics (#9963). This
regression was introduced in 1d6124de.
Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this
from happening again.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D730
GHC Trac Issues: #9963
>---------------------------------------------------------------
5166ee94e439375a4e6acb80f88ec6ee65476bbd
compiler/basicTypes/SrcLoc.hs | 5 +----
compiler/main/CmdLineParser.hs | 24 +++++++++++++++++++++---
compiler/main/DynFlags.hs | 10 +++++++---
compiler/main/StaticFlags.hs | 7 +++++--
compiler/typecheck/TcGenDeriv.hs | 6 ++++--
compiler/utils/Outputable.hs | 8 +++++---
ghc/Main.hs | 9 ++++++---
testsuite/tests/driver/T9963.stderr | 2 ++
testsuite/tests/driver/all.T | 3 +++
9 files changed, 54 insertions(+), 20 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5166ee94e439375a4e6acb80f88ec6ee65476bbd
More information about the ghc-commits
mailing list