Skip to content

Commit

Permalink
Use new what4 bitvector helpers, hlint in crux-{llvm,mir}
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Apr 3, 2024
1 parent 2fc98be commit 663263e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ jobs:
(cd crucible-symio/; ../hlint-3.8/hlint src tests)
(cd crucible-syntax/; ../hlint-3.8/hlint src test)
(cd crucible-wasm/; ../hlint-3.8/hlint src test)
(cd crux-llvm/; ../hlint-3.8/hlint src test)
(cd crux-wasm/; ../hlint-3.8/hlint src test)
2 changes: 1 addition & 1 deletion crux-llvm/src/Crux/LLVM/Overrides.hs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ fresh_str arch mvar (Empty :> pName :> maxLen) =

-- Compute the allocation length, which is the requested length plus one
-- to hold the NUL terminator
one <- liftIO $ bvLit sym ?ptrWidth (BV.one ?ptrWidth)
one <- liftIO $ bvOne sym ?ptrWidth
-- maxLenBV <- liftIO $ projectLLVM_bv sym (regValue maxLen)
len <- liftIO $ bvAdd sym (regValue maxLen) one
mem0 <- readGlobal mvar
Expand Down
2 changes: 1 addition & 1 deletion crux-llvm/src/Crux/LLVM/Simulate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ checkFun llvmOpts trans memVar =
mem <- case lookupGlobal memVar gs of
Just mem -> pure mem
Nothing -> fail "checkFun.checkMainWithArguments: Memory missing from global vars"
argc <- liftIO $ LLVMPointer <$> natLit sym 0 <*> bvLit sym w (BV.zero w)
argc <- liftIO $ LLVMPointer <$> natLit sym 0 <*> bvZero sym w
sz <- liftIO $ bvLit sym PtrWidth $ bytesToBV PtrWidth tp_sz
(argv, mem') <- liftIO $ doAlloca bak mem sz alignment loc
stateTree.actFrame.gpGlobals %= insertGlobal memVar mem'
Expand Down
2 changes: 1 addition & 1 deletion crux-mir/src/Mir/Overrides.hs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ regEval bak baseEval tpr v = go tpr v

let vec = MirVector_Vector $ V.fromList vals
let vecRef = newConstMirRef sym (MirVectorRepr tpr') vec
ptr <- subindexMirRefSim tpr' vecRef =<< liftIO (bvLit sym knownRepr (BV.zero knownRepr))
ptr <- subindexMirRefSim tpr' vecRef =<< liftIO (bvZero sym knownRepr)
return $ Empty :> RV ptr :> RV len'

go (FloatRepr fi) v = pure v
Expand Down

0 comments on commit 663263e

Please sign in to comment.