aboutsummaryrefslogtreecommitdiff
path: root/X64.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-09-01 18:14:43 +0200
committertomsmeding <tom.smeding@gmail.com>2017-09-01 18:15:25 +0200
commit19c70b8eaa1126f1648b009d99092432a5c88059 (patch)
treebd4171a4d6ef5e8ae2b09e1c84bf3e2346374e97 /X64.hs
parent3d5d85e00f2a81efb62bb17f8e5db63fe5a49a61 (diff)
Structs + typedefs
Diffstat (limited to 'X64.hs')
-rw-r--r--X64.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/X64.hs b/X64.hs
index 26c35dd..0cbf4fc 100644
--- a/X64.hs
+++ b/X64.hs
@@ -190,7 +190,7 @@ instance Stringifiable XRef where
szword 2 = "word"
szword 4 = "dword"
szword 8 = "qword"
- szword _ = undefined
+ szword s = error $ "Invalid (szword " ++ show s ++ ") in stringify XMem"
stringify (XImm imm) = show imm
@@ -283,6 +283,10 @@ xrefSetSize sz (XReg _ r) = XReg sz r
xrefSetSize sz (XMem _ a b c d) = XMem sz a b c d
xrefSetSize _ x@(XImm _) = x
+offsetXMem :: Offset -> XRef -> XRef
+offsetXMem off (XMem sz mr tup lbl o) = XMem sz mr tup lbl (o + off)
+offsetXMem _ _ = undefined
+
isXReg :: XRef -> Bool
isXReg (XReg _ _) = True
isXReg _ = False