Skip to content

Commit

Permalink
Merge pull request #694 from GaloisInc/resolvesetupvalue-fail
Browse files Browse the repository at this point in the history
Ensure that SAW builds on GHC 8.8
  • Loading branch information
chameco authored Apr 28, 2020
2 parents e0328e9 + e01a1cc commit 93d8881
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SAWScript/Crucible/LLVM/ResolveSetupValue.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module SAWScript.Crucible.LLVM.ResolveSetupValue

import Control.Lens ((^.))
import Control.Monad
import Control.Monad.Catch (MonadThrow)
import Control.Monad.Fail (MonadFail)
import Control.Monad.State
import Data.Foldable (toList)
import Data.Maybe (fromMaybe, listToMaybe, fromJust)
Expand Down Expand Up @@ -125,7 +125,7 @@ resolveSetupFieldIndex cc env nameEnv v n =
lc = ccTypeCtx cc

resolveSetupFieldIndexOrFail ::
MonadThrow m =>
MonadFail m =>
LLVMCrucibleContext arch {- ^ crucible context -} ->
Map AllocIndex LLVMAllocSpec {- ^ allocation types -} ->
Map AllocIndex Crucible.Ident {- ^ allocation type names -} ->
Expand All @@ -148,7 +148,7 @@ resolveSetupFieldIndexOrFail cc env nameEnv v n =
_ -> unlines [msg, "No field names were found for this struct"]

typeOfSetupValue ::
MonadThrow m =>
MonadFail m =>
LLVMCrucibleContext arch ->
Map AllocIndex LLVMAllocSpec ->
Map AllocIndex Crucible.Ident ->
Expand All @@ -159,7 +159,7 @@ typeOfSetupValue cc env nameEnv val =
typeOfSetupValue' cc env nameEnv val

typeOfSetupValue' :: forall m arch.
MonadThrow m =>
MonadFail m =>
LLVMCrucibleContext arch ->
Map AllocIndex LLVMAllocSpec ->
Map AllocIndex Crucible.Ident ->
Expand Down
3 changes: 3 additions & 0 deletions src/SAWScript/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Prelude hiding (fail)
import Control.Applicative (Applicative)
#endif
import Control.Lens
import Control.Monad.Fail (MonadFail(..))
import Control.Monad.Catch (MonadThrow(..))
import Control.Monad.Except (ExceptT(..), runExceptT)
import Control.Monad.Reader (MonadReader)
Expand Down Expand Up @@ -399,6 +400,8 @@ newtype TopLevel a =
deriving instance MonadReader TopLevelRO TopLevel
deriving instance MonadState TopLevelRW TopLevel
instance Wrapped (TopLevel a) where
instance MonadFail TopLevel where
fail = throwTopLevel

runTopLevel :: TopLevel a -> TopLevelRO -> TopLevelRW -> IO (a, TopLevelRW)
runTopLevel (TopLevel m) ro rw = runStateT (runReaderT m ro) rw
Expand Down

0 comments on commit 93d8881

Please sign in to comment.