From: Bernhard Urban Date: Thu, 26 Apr 2012 14:44:54 +0000 (+0200) Subject: fields: don't multiple the offset with 4 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mate.git;a=commitdiff_plain;h=70bb56a1047afaecc2c33da63b1bfb414fe022fc fields: don't multiple the offset with 4 it's already correct in the table, noob... --- 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