Add support for forcing allocation of fresh bits (as opposed to pointer/bits)

This commit is contained in:
Iavor Diatchki 2018-03-22 13:11:22 -07:00
parent cf34388d41
commit 79a4cdf39e
2 changed files with 3 additions and 3 deletions

View File

@ -350,13 +350,13 @@ freshValue ::
(IsSymInterface sym, 1 <= ptrW) =>
sym ->
String {- ^ Name for fresh value -} ->
NatRepr ptrW {- ^ Width of pointers -} ->
Maybe (NatRepr ptrW) {- ^ Width of pointers; if nothing, allocate as bits -} ->
M.TypeRepr tp {- ^ Type of value -} ->
IO (C.RegValue sym (ToCrucibleType tp))
freshValue sym str w ty =
case ty of
M.BVTypeRepr y ->
case testEquality y w of
case testEquality y =<< w of
Just Refl ->
do nm_base <- symName (str ++ "_base")

View File

@ -171,7 +171,7 @@ updateX86Reg r upd asgn =
freshX86Reg :: C.IsSymInterface sym =>
sym -> M.X86Reg t -> IO (RegValue' sym (ToCrucibleType t))
freshX86Reg sym r =
RV <$> freshValue sym (show r) (C.knownNat @64) (M.typeRepr r)
RV <$> freshValue sym (show r) (Just (C.knownNat @64)) (M.typeRepr r)
------------------------------------------------------------------------