Skip to content

Commit

Permalink
Cache basic_ss inside LLVMCrucibleContext, for use in resolveSAWTerm.
Browse files Browse the repository at this point in the history
Fixes #590.
  • Loading branch information
Brian Huffman committed Nov 17, 2019
1 parent cb714ce commit 8fa6313
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/SAWScript/Crucible/LLVM/Builtins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ setupLLVMCrucibleContext bic opts lm@(LLVMModule _ llvm_mod mtrans) action = do
, _ccBackend = sym
, _ccLLVMSimContext = lsimctx
, _ccLLVMGlobals = lglobals
, _ccBasicSS = biBasicSS bic
}
)

Expand Down
2 changes: 2 additions & 0 deletions src/SAWScript/Crucible/LLVM/MethodSpecIR.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import qualified SAWScript.Crucible.Common.Setup.Type as Setup

import qualified SAWScript.Crucible.LLVM.CrucibleLLVM as CL

import Verifier.SAW.Rewriter (Simpset)
import Verifier.SAW.SharedTerm
import Verifier.SAW.TypedTerm

Expand Down Expand Up @@ -211,6 +212,7 @@ data LLVMCrucibleContext arch =
, _ccBackend :: Sym
, _ccLLVMSimContext :: Crucible.SimContext (Crucible.SAWCruciblePersonality Sym) Sym (CL.LLVM arch)
, _ccLLVMGlobals :: Crucible.SymGlobalState Sym
, _ccBasicSS :: Simpset
}

makeLenses ''LLVMCrucibleContext
Expand Down
2 changes: 1 addition & 1 deletion src/SAWScript/Crucible/LLVM/ResolveSetupValue.hs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ resolveSAWTerm cc tp tm =
Just (Some w)
| Just LeqProof <- isPosNat w ->
do sc <- Crucible.saw_ctx <$> readIORef (W4.sbStateManager sym)
ss <- basic_ss sc
let ss = cc^.ccBasicSS
tm' <- rewriteSharedTerm sc ss tm
mx <- case getAllExts tm' of
[] -> do
Expand Down

0 comments on commit 8fa6313

Please sign in to comment.