Commit 1d704e17 authored by dterei's avatar dterei

SafeHaskell: Make base GHC.* modules untrusted

parent 90bab6b8
......@@ -29,7 +29,7 @@ module UniqSupply (
import Unique
import FastTypes
import GhcIO (unsafeDupableInterleaveIO)
import GHC.IO (unsafeDupableInterleaveIO)
import MonadUtils
import Control.Monad
......
......@@ -435,7 +435,6 @@ Library
FastTypes
Fingerprint
FiniteMap
GhcIO
GraphBase
GraphColor
GraphOps
......
......@@ -36,7 +36,7 @@ import Foreign.C.String
import Data.Bits ( Bits(..), shiftR )
import GHC.Exts ( Int(I#), addr2Int# )
import GHC.Ptr.Unsafe ( Ptr(..) )
import GHC.Ptr ( Ptr(..) )
import Debug.Trace
import Text.Printf
......
......@@ -44,7 +44,7 @@ import Data.Array.Base
import Control.Monad ( zipWithM )
import Control.Monad.ST ( stToIO )
import GHC.Arr.Unsafe ( Array(..), STArray(..) )
import GHC.Arr ( Array(..), STArray(..) )
import GHC.Base ( writeArray#, RealWorld, Int(..), Word# )
import GHC.IOBase ( IO(..) )
import GHC.Exts
......
......@@ -53,9 +53,9 @@ import DynFlags
import Outputable as Ppr
import FastString
import Constants ( wORD_SIZE )
import GHC.Arr.Unsafe ( Array(..) )
import GHC.Arr ( Array(..) )
import GHC.Exts
import GhcIO ( IO(..) )
import GHC.IO ( IO(..) )
import StaticFlags( opt_PprStyle_Debug )
import Control.Monad
......
......@@ -26,7 +26,7 @@ module BreakArray
) where
#ifdef GHCI
import GHC.Exts
import GhcIO ( IO(..) )
import GHC.IO ( IO(..) )
import Constants
data BreakArray = BA (MutableByteArray# RealWorld)
......
......@@ -313,10 +313,10 @@ dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
gHC_CONC = mkBaseModule (fsLit "GHC.Conc")
gHC_IO = mkBaseModule (fsLit "GHC.IO")
gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
gHC_ST = mkBaseModule (fsLit "GHC.ST.Imp")
gHC_ARR = mkBaseModule (fsLit "GHC.Arr.Imp")
gHC_STABLE = mkBaseModule (fsLit "GHC.Stable.Imp")
gHC_PTR = mkBaseModule (fsLit "GHC.Ptr.Imp")
gHC_ST = mkBaseModule (fsLit "GHC.ST")
gHC_ARR = mkBaseModule (fsLit "GHC.Arr")
gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
gHC_PTR = mkBaseModule (fsLit "GHC.Ptr")
gHC_ERR = mkBaseModule (fsLit "GHC.Err")
gHC_REAL = mkBaseModule (fsLit "GHC.Real")
gHC_FLOAT = mkBaseModule (fsLit "GHC.Float")
......
......@@ -82,7 +82,7 @@ import GHC.Real ( Ratio(..) )
import GHC.Exts
import GHC.Word ( Word8(..) )
import GhcIO ( IO(..) )
import GHC.IO ( IO(..) )
type BinArray = ForeignPtr Word8
......
......@@ -32,11 +32,7 @@ module Encoding (
import Foreign
import Data.Char
import Numeric
#if __GLASGOW_HASKELL__ >= 701
import GHC.Ptr.Unsafe ( Ptr(..) )
#else
import GHC.Ptr ( Ptr(..) )
#endif
import GHC.Ptr ( Ptr(..) )
import GHC.Base
-- -----------------------------------------------------------------------------
......
......@@ -24,7 +24,7 @@ import GHC.Exts
import GHC.Word
import GHC.Base (unsafeChr)
import GhcIO (IO(..), unsafeDupableInterleaveIO)
import GHC.IO (IO(..), unsafeDupableInterleaveIO)
-- Just like unsafePerformIO, but we inline it.
{-# INLINE inlinePerformIO #-}
......
......@@ -26,12 +26,7 @@ module FastMutInt(
#endif
import GHC.Base
#if __GLASGOW_HASKELL__ >= 701
import GHC.Ptr.Safe
import GHC.Ptr.Unsafe
#else
import GHC.Ptr
#endif
#else /* ! __GLASGOW_HASKELL__ */
......
......@@ -105,14 +105,13 @@ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
import Data.Maybe ( isJust )
import Data.Char ( ord )
import GhcIO ( IO(..) )
import GHC.IO ( IO(..) )
import GHC.Ptr ( Ptr(..) )
#if __GLASGOW_HASKELL__ >= 701
import Foreign.Safe
import GHC.Ptr.Unsafe ( Ptr(..) )
#else
import Foreign hiding ( unsafePerformIO )
import GHC.Ptr ( Ptr(..) )
#endif
#if defined(__GLASGOW_HASKELL__)
......
-- | A simple version compatability wrapper around GHC.IO.
--
-- This module exports both the safe and Unsafe version of GHC.IO
-- taking care of the SafeHaskell changeover which spit up the
-- old GHC.IO module.
--
module GhcIO (
#if __GLASGOW_HASKELL__ >= 701
module GHC.IO.Safe,
module GHC.IO.Unsafe
#else
module GHC.IO
#endif
) where
#if __GLASGOW_HASKELL__ >= 701
import GHC.IO.Safe
import GHC.IO.Unsafe
#else
import GHC.IO
#endif
......@@ -193,11 +193,7 @@ import System.IO
--for a RULES
import GHC.Base ( unpackCString# )
import GHC.Exts ( Int# )
#if __GLASGOW_HASKELL__ >= 701
import GHC.Ptr.Unsafe ( Ptr(..) )
#else
import GHC.Ptr ( Ptr(..) )
#endif
import GHC.Ptr ( Ptr(..) )
#endif
-- Don't import Util( assertPanic ) because it makes a loop in the module structure
......
......@@ -43,7 +43,7 @@ PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination_closure);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
PRELUDE_CLOSURE(base_GHCziConcziSyncziImp_runSparks_closure);
PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure);
PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure);
PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlers_closure);
......@@ -52,8 +52,8 @@ PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_static_info);
PRELUDE_INFO(ghczmprim_GHCziTypes_Fzh_static_info);
PRELUDE_INFO(ghczmprim_GHCziTypes_Dzh_static_info);
PRELUDE_INFO(base_Addr_Azh_static_info);
PRELUDE_INFO(base_GHCziPtrziImp_Ptr_static_info);
PRELUDE_INFO(base_GHCziPtrziImp_FunPtr_static_info);
PRELUDE_INFO(base_GHCziPtr_Ptr_static_info);
PRELUDE_INFO(base_GHCziPtr_FunPtr_static_info);
PRELUDE_INFO(base_GHCziInt_I8zh_static_info);
PRELUDE_INFO(base_GHCziInt_I16zh_static_info);
PRELUDE_INFO(base_GHCziInt_I32zh_static_info);
......@@ -67,8 +67,8 @@ PRELUDE_INFO(ghczmprim_GHCziTypes_Czh_con_info);
PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_con_info);
PRELUDE_INFO(ghczmprim_GHCziTypes_Fzh_con_info);
PRELUDE_INFO(ghczmprim_GHCziTypes_Dzh_con_info);
PRELUDE_INFO(base_GHCziPtrziImp_Ptr_con_info);
PRELUDE_INFO(base_GHCziPtrziImp_FunPtr_con_info);
PRELUDE_INFO(base_GHCziPtr_Ptr_con_info);
PRELUDE_INFO(base_GHCziPtr_FunPtr_con_info);
PRELUDE_INFO(base_Addr_Azh_con_info);
PRELUDE_INFO(base_GHCziWord_Wzh_con_info);
PRELUDE_INFO(base_GHCziInt_I8zh_con_info);
......@@ -79,8 +79,8 @@ PRELUDE_INFO(base_GHCziWord_W8zh_con_info);
PRELUDE_INFO(base_GHCziWord_W16zh_con_info);
PRELUDE_INFO(base_GHCziWord_W32zh_con_info);
PRELUDE_INFO(base_GHCziWord_W64zh_con_info);
PRELUDE_INFO(base_GHCziStableziImp_StablePtr_static_info);
PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
PRELUDE_INFO(base_GHCziStable_StablePtr_static_info);
PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
#define True_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_True_closure)
#define False_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_False_closure)
......@@ -88,7 +88,7 @@ PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
#define runFinalizerBatch_closure DLL_IMPORT_DATA_REF(base_GHCziWeak_runFinalizzerBatch_closure)
#define mainIO_closure (&ZCMain_main_closure)
#define runSparks_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSyncziImp_runSparks_closure)
#define runSparks_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSync_runSparks_closure)
#define ensureIOManagerIsRunning_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ensureIOManagerIsRunning_closure)
#define runHandlers_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSignal_runHandlers_closure)
......@@ -113,8 +113,8 @@ PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
#define W16zh_static_info DLL_IMPORT_DATA_REF(base_GHCziWord_W16zh_static_info)
#define W32zh_static_info DLL_IMPORT_DATA_REF(base_GHCziWord_W32zh_static_info)
#define W64zh_static_info DLL_IMPORT_DATA_REF(base_GHCziWord_W64zh_static_info)
#define Ptr_static_info DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_Ptr_static_info)
#define FunPtr_static_info DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_FunPtr_static_info)
#define Ptr_static_info DLL_IMPORT_DATA_REF(base_GHCziPtr_Ptr_static_info)
#define FunPtr_static_info DLL_IMPORT_DATA_REF(base_GHCziPtr_FunPtr_static_info)
#define Czh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Czh_con_info)
#define Izh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Izh_con_info)
#define Fzh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Fzh_con_info)
......@@ -130,9 +130,9 @@ PRELUDE_INFO(base_GHCziStableziImp_StablePtr_con_info);
#define I32zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I32zh_con_info)
#define I64zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I64zh_con_info)
#define I64zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I64zh_con_info)
#define Ptr_con_info DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_Ptr_con_info)
#define FunPtr_con_info DLL_IMPORT_DATA_REF(base_GHCziPtrziImp_FunPtr_con_info)
#define StablePtr_static_info DLL_IMPORT_DATA_REF(base_GHCziStableziImp_StablePtr_static_info)
#define StablePtr_con_info DLL_IMPORT_DATA_REF(base_GHCziStableziImp_StablePtr_con_info)
#define Ptr_con_info DLL_IMPORT_DATA_REF(base_GHCziPtr_Ptr_con_info)
#define FunPtr_con_info DLL_IMPORT_DATA_REF(base_GHCziPtr_FunPtr_con_info)
#define StablePtr_static_info DLL_IMPORT_DATA_REF(base_GHCziStable_StablePtr_static_info)
#define StablePtr_con_info DLL_IMPORT_DATA_REF(base_GHCziStable_StablePtr_con_info)
#endif /* PRELUDE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment