From 716de707c2abc732d543d3a6a672eb50c4e29569 Mon Sep 17 00:00:00 2001 From: Joe Hendrix Date: Fri, 1 Dec 2017 15:09:07 -0800 Subject: [PATCH] Fix failing x86 tests broken by last commit. --- x86/src/Data/Macaw/X86/Semantics.hs | 8 ++++---- x86/tests/ElfX64Linux.hs | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/x86/src/Data/Macaw/X86/Semantics.hs b/x86/src/Data/Macaw/X86/Semantics.hs index 3d496cb6..151cc5c8 100644 --- a/x86/src/Data/Macaw/X86/Semantics.hs +++ b/x86/src/Data/Macaw/X86/Semantics.hs @@ -2584,10 +2584,10 @@ all_instructions = , def_punpck "hdq" fst n32 , def_punpck "hqdq" fst n64 - , def_punpck "lbw" snd n8 - , def_punpck "lwd" snd n16 - , def_punpck "ldq" snd n32 - , def_punpck "ldq" snd n64 + , def_punpck "lbw" snd n8 + , def_punpck "lwd" snd n16 + , def_punpck "ldq" snd n32 + , def_punpck "lqdq" snd n64 , def_padd "b" n8 , def_padd "w" n16 diff --git a/x86/tests/ElfX64Linux.hs b/x86/tests/ElfX64Linux.hs index d83de10f..d68c7320 100644 --- a/x86/tests/ElfX64Linux.hs +++ b/x86/tests/ElfX64Linux.hs @@ -27,7 +27,6 @@ import qualified Data.Parameterized.Some as PU import qualified Data.Macaw.Memory as MM import qualified Data.Macaw.Memory.ElfLoader as MM import qualified Data.Macaw.Discovery as MD -import qualified Data.Macaw.Discovery.State as MD import qualified Data.Macaw.X86 as RO elfX64LinuxTests :: [FilePath] -> T.TestTree @@ -95,8 +94,12 @@ withMemory :: forall w m a -> E.Elf w -> (MM.Memory w -> m a) -> m a -withMemory relaWidth e k = - case MM.memoryForElf (MM.LoadOptions MM.LoadBySegment False) e of +withMemory _relaWidth e k = do + let opt = MM.LoadOptions { MM.loadRegionIndex = 0 + , MM.loadStyle = MM.LoadBySegment + , MM.includeBSS = False + } + case MM.memoryForElf opt e of -- case MM.memoryForElfSegments relaWidth e of Left err -> C.throwM (MemoryLoadError err) Right (_sim, mem) -> k mem