From 19c70b8eaa1126f1648b009d99092432a5c88059 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 1 Sep 2017 18:14:43 +0200 Subject: Structs + typedefs --- X64.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'X64.hs') 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 -- cgit v1.2.3-70-g09d2