Rename Opt_FFI to Opt_ForeignFunctionInterface to match the language name
[ghc-hetmet.git] / compiler / codeGen / CgPrimOp.hs
index 01279b4..e489d73 100644 (file)
@@ -20,16 +20,13 @@ import CgBindery
 import CgMonad
 import CgInfoTbls
 import CgUtils
-import ForeignCall
 import Cmm
 import CLabel
 import CmmUtils
 import MachOp
-import SMRep
 import PrimOp
 import SMRep
 import Constants
-import StaticFlags
 import Outputable
 
 -- ---------------------------------------------------------------------------
@@ -186,8 +183,9 @@ emitPrimOp [res] AddrToHValueOp [arg] live
    = stmtC (CmmAssign (CmmLocal res) arg)
 
 --  #define dataToTagzh(r,a)  r=(GET_TAG(((StgClosure *)a)->header.info))
+--  Note: argument may be tagged!
 emitPrimOp [res] DataToTagOp [arg] live
-   = stmtC (CmmAssign (CmmLocal res) (getConstrTag arg))
+   = stmtC (CmmAssign (CmmLocal res) (getConstrTag (cmmUntag arg)))
 
 {- Freezing arrays-of-ptrs requires changing an info table, for the
    benefit of the generational collector.  It needs to scavenge mutable