summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2011-04-25 13:05:47 -0700
committerDavid Terei <davidterei@gmail.com>2011-06-17 18:39:23 -0700
commit45c64c1da96dc26ebc89b080dc12cfcc52a4cd68 (patch)
tree8c22db8a74da733b44d9ad9d8d7a7a6637726016 /compiler/rename
parent94434054df5633fc7aef9aad37aa26c8b2e011cd (diff)
downloadhaskell-45c64c1da96dc26ebc89b080dc12cfcc52a4cd68.tar.gz
SafeHaskell: Disable certain ghc extensions in Safe.
This patch disables the use of some GHC extensions in Safe mode and also the use of certain flags. Some are disabled completely while others are only allowed on the command line and not in source PRAGMAS. We also check that Safe imports are indeed importing a Safe or Trustworthy module.
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnNames.lhs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs
index cd1cff6983..d2ad9af668 100644
--- a/compiler/rename/RnNames.lhs
+++ b/compiler/rename/RnNames.lhs
@@ -219,7 +219,10 @@ rnImportDecl this_mod implicit_prelude
Just (is_hiding, ls) -> not is_hiding && null ls
_ -> False
- mod_safe' = mod_safe || safeImportsRequired dflags
+ -- should the import be safe?
+ mod_safe' = mod_safe
+ || (not implicit_prelude && safeDirectImpsReq dflags)
+ || (implicit_prelude && safeImplicitImpsReq dflags)
imports = ImportAvails {
imp_mods = unitModuleEnv imp_mod [(qual_mod_name, import_all, loc, mod_safe')],