From 70bb56a1047afaecc2c33da63b1bfb414fe022fc Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Thu, 26 Apr 2012 16:44:54 +0200 Subject: [PATCH] fields: don't multiple the offset with 4 it's already correct in the table, noob... --- Mate/X86CodeGen.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mate/X86CodeGen.hs b/Mate/X86CodeGen.hs index ff9ca2d..59ccb42 100644 --- a/Mate/X86CodeGen.hs +++ b/Mate/X86CodeGen.hs @@ -307,13 +307,13 @@ emitFromBB method cls hmap = do pop eax -- this pointer let (cname, fname) = buildFieldOffset cls x offset <- liftIO $ getFieldOffset cname fname - push (Disp (fromIntegral $ offset * 4), eax) -- get field + push (Disp (fromIntegral $ offset), eax) -- get field emit (PUTFIELD x) = do pop ebx -- value to write pop eax -- this pointer let (cname, fname) = buildFieldOffset cls x offset <- liftIO $ getFieldOffset cname fname - mov (Disp (fromIntegral $ offset * 4), eax) ebx -- set field + mov (Disp (fromIntegral $ offset), eax) ebx -- set field emit IADD = do pop ebx; pop eax; add eax ebx; push eax emit ISUB = do pop ebx; pop eax; sub eax ebx; push eax -- 2.25.1