From: simonmar Date: Fri, 19 Sep 2003 15:58:00 +0000 (+0000) Subject: [project @ 2003-09-19 15:58:00 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~441 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=14b100771dd80b774ea51388494cf0e24160db2d;p=ghc-hetmet.git [project @ 2003-09-19 15:58:00 by simonmar] The whole family of indexOffForeignPtr# primops has been broken for some time now. This commit fixes them. I'm tempted to get rid of them altogether, since arguably the withForeignPtr interface subsumes all this. But if you want to index off a ForeignPtr in pure code, you have to use unsafePerformIO, which is hard to optimise away (GHC doesn't do it), so these primops still have their uses. --- diff --git a/ghc/compiler/absCSyn/AbsCUtils.lhs b/ghc/compiler/absCSyn/AbsCUtils.lhs index 7dfd8ee..f842d19 100644 --- a/ghc/compiler/absCSyn/AbsCUtils.lhs +++ b/ghc/compiler/absCSyn/AbsCUtils.lhs @@ -663,7 +663,7 @@ mk_OSBI_ref offw rep base idx doIndexOffForeignObjOp maybe_post_read_cast rep res addr idx - = mkBasicIndexedRead fixedHdrSize maybe_post_read_cast rep res addr idx + = mkBasicIndexedRead 0 maybe_post_read_cast rep res (mkDerefOff WordRep addr fixedHdrSize) idx doIndexOffAddrOp maybe_post_read_cast rep res addr idx = mkBasicIndexedRead 0 maybe_post_read_cast rep res addr idx