From b7c31180703ad086898a24c2e1a46a231ba6972e Mon Sep 17 00:00:00 2001 From: Tristan Ravitch Date: Fri, 30 Mar 2018 10:52:58 -0700 Subject: [PATCH] Update the calls to `asAtomicStateUpdate` The type of the instruction address changed --- macaw-arm/src/Data/Macaw/ARM/Disassemble.hs | 6 +++--- macaw-ppc/src/Data/Macaw/PPC/Disassemble.hs | 6 +++--- macaw-semmc/src/Data/Macaw/SemMC/Generator.hs | 2 +- submodules/macaw | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/macaw-arm/src/Data/Macaw/ARM/Disassemble.hs b/macaw-arm/src/Data/Macaw/ARM/Disassemble.hs index 8c0e5d10..a303a0f4 100644 --- a/macaw-arm/src/Data/Macaw/ARM/Disassemble.hs +++ b/macaw-arm/src/Data/Macaw/ARM/Disassemble.hs @@ -141,9 +141,9 @@ disassembleBlock lookupSemantics mem gs curPCAddr maxOffset = do nextPCVal = MC.RelocatableValue (knownNat :: NatRepr (ArchAddrWidth arm)) nextPC -- Note: In ARM, the IP is incremented *after* an instruction -- executes; pass in the physical address of the instruction here. - (ipAddr, ipVal) <- case MM.asAbsoluteAddr (MM.relativeSegmentAddr curPCAddr) of + ipVal <- case MM.asAbsoluteAddr (MM.relativeSegmentAddr curPCAddr) of Nothing -> failAt gs off curPCAddr (InstructionAtUnmappedAddr i) - Just addr -> return (addr, BVValue (knownNat :: NatRepr (ArchAddrWidth arm)) (fromIntegral addr)) + Just addr -> return (BVValue (knownNat :: NatRepr (ArchAddrWidth arm)) (fromIntegral addr)) case lookupSemantics ipVal i of Nothing -> failAt gs off curPCAddr (UnsupportedInstruction i) Just transformer -> do @@ -155,7 +155,7 @@ disassembleBlock lookupSemantics mem gs curPCAddr maxOffset = do A32I i' -> ARMD.ppInstruction i' T32I i' -> ThumbD.ppInstruction i')) addStmt (Comment (T.pack lineStr)) - asAtomicStateUpdate ipAddr transformer + asAtomicStateUpdate (MM.relativeSegmentAddr curPCAddr) transformer -- Check to see if the PC has become conditionally-defined (by e.g., -- a mux). If it has, we need to split execution using a primitive diff --git a/macaw-ppc/src/Data/Macaw/PPC/Disassemble.hs b/macaw-ppc/src/Data/Macaw/PPC/Disassemble.hs index e9a922d4..0b2e632b 100644 --- a/macaw-ppc/src/Data/Macaw/PPC/Disassemble.hs +++ b/macaw-ppc/src/Data/Macaw/PPC/Disassemble.hs @@ -112,9 +112,9 @@ disassembleBlock lookupSemantics mem gs curIPAddr maxOffset = do -- Note: In PowerPC, the IP is incremented *after* an instruction -- executes, rather than before as in X86. We have to pass in the -- physical address of the instruction here. - (ipWord, ipVal) <- case MM.asAbsoluteAddr (MM.relativeSegmentAddr curIPAddr) of + ipVal <- case MM.asAbsoluteAddr (MM.relativeSegmentAddr curIPAddr) of Nothing -> failAt gs off curIPAddr (InstructionAtUnmappedAddr i) - Just addr -> return (addr, BVValue (pointerNatRepr (Proxy @ppc)) (fromIntegral addr)) + Just addr -> return (BVValue (pointerNatRepr (Proxy @ppc)) (fromIntegral addr)) case lookupSemantics ipVal i of Nothing -> failAt gs off curIPAddr (UnsupportedInstruction i) Just transformer -> do @@ -124,7 +124,7 @@ disassembleBlock lookupSemantics mem gs curIPAddr maxOffset = do egs1 <- liftST $ ET.runExceptT (runGenerator genResult gs $ do let lineStr = printf "%s: %s" (show curIPAddr) (show (D.ppInstruction i)) addStmt (Comment (T.pack lineStr)) - asAtomicStateUpdate ipWord transformer + asAtomicStateUpdate (MM.relativeSegmentAddr curIPAddr) transformer -- Check to see if the IP has become conditionally-defined (by e.g., -- a mux). If it has, we need to split execution using a primitive diff --git a/macaw-semmc/src/Data/Macaw/SemMC/Generator.hs b/macaw-semmc/src/Data/Macaw/SemMC/Generator.hs index 08396031..318cec48 100644 --- a/macaw-semmc/src/Data/Macaw/SemMC/Generator.hs +++ b/macaw-semmc/src/Data/Macaw/SemMC/Generator.hs @@ -178,7 +178,7 @@ curRegState = blockState . pBlockState -- transformer is executed. Note: if the transformer splits the state, it isn't -- obvious what will happen here. The mechanism is not designed with that use -- case in mind. -asAtomicStateUpdate :: ArchAddrWord arch +asAtomicStateUpdate :: ArchMemAddr arch -- ^ Instruction address -> Generator arch ids s a -- ^ An action recording the state transformations of the instruction diff --git a/submodules/macaw b/submodules/macaw index ce96c558..4bd307e4 160000 --- a/submodules/macaw +++ b/submodules/macaw @@ -1 +1 @@ -Subproject commit ce96c5589683b8ab8a545a2defa6f83423cade86 +Subproject commit 4bd307e41d114d824300e08d7e9953a728663ee3