[project @ 1998-11-08 17:08:34 by sof]
authorsof <unknown>
Sun, 8 Nov 1998 17:08:34 +0000 (17:08 +0000)
committersof <unknown>
Sun, 8 Nov 1998 17:08:34 +0000 (17:08 +0000)
primOpInfo WriteOffAddrOp fixed

ghc/compiler/prelude/PrimOp.lhs

index 71ad733..836e8c4 100644 (file)
@@ -1213,13 +1213,17 @@ primOpInfo (IndexOffForeignObjOp kind)
 
 primOpInfo (WriteOffAddrOp kind)
   = let
-       s = alphaTy; s_tv = alphaTyVar
+       s = betaTy; s_tv = betaTyVar
 
        (str, prim_ty, _) = getPrimRepInfo kind
        op_str = _PK_ ("write" ++ str ++ "OffAddr#")
+
+        tvs
+         | kind == StablePtrRep = [s_tv,alphaTyVar]
+         | otherwise            = [s_tv]
     in
     -- NB: *Prim*Result --
-    PrimResult op_str [s_tv]
+    PrimResult op_str tvs
        [addrPrimTy, intPrimTy, prim_ty, mkStatePrimTy s]
        statePrimTyCon VoidRep [s]