summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-03-02 14:36:16 +0000
committersimonmar <unknown>2001-03-02 14:36:16 +0000
commitffaa26145a8142d9a24bfc6b4a8607d94818b812 (patch)
treedffd97cea3aacfde56a02f4b3a9794f5de05e8ed
parent18f73b07621d157c948ec6a86c173c9915712896 (diff)
downloadhaskell-ffaa26145a8142d9a24bfc6b4a8607d94818b812.tar.gz
[project @ 2001-03-02 14:36:16 by simonmar]
Add some ASSERT()s so we can catch updates where updatee==target.
-rw-r--r--ghc/rts/Storage.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/ghc/rts/Storage.h b/ghc/rts/Storage.h
index 6311084d89..2ae12f663c 100644
--- a/ghc/rts/Storage.h
+++ b/ghc/rts/Storage.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Storage.h,v 1.29 2001/02/11 17:51:08 simonmar Exp $
+ * $Id: Storage.h,v 1.30 2001/03/02 14:36:16 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -169,6 +169,7 @@ recordOldToNewPtrs(StgMutClosure *p)
{ \
bdescr *bd; \
\
+ ASSERT( p1 != p2 ); \
bd = Bdescr((P_)p1); \
if (bd->gen->no == 0) { \
((StgInd *)p1)->indirectee = p2; \
@@ -176,14 +177,14 @@ recordOldToNewPtrs(StgMutClosure *p)
TICK_UPD_NEW_IND(); \
} else { \
if (info != &stg_BLACKHOLE_BQ_info) { \
- { \
+ { \
StgInfoTable *inf = get_itbl(p1); \
nat np = inf->layout.payload.ptrs, \
nw = inf->layout.payload.nptrs, i; \
- if (inf->type != THUNK_SELECTOR) { \
+ if (inf->type != THUNK_SELECTOR) { \
for (i = np; i < np + nw; i++) { \
((StgClosure *)p1)->payload[i] = 0; \
- } \
+ } \
} \
} \
ACQUIRE_LOCK(&sm_mutex); \
@@ -202,6 +203,7 @@ recordOldToNewPtrs(StgMutClosure *p)
*/
#define updateWithStaticIndirection(info, p1, p2) \
{ \
+ ASSERT( p1 != p2 ); \
ASSERT( ((StgMutClosure*)p1)->mut_link == NULL ); \
\
ACQUIRE_LOCK(&sm_mutex); \
@@ -220,6 +222,7 @@ updateWithPermIndirection(const StgInfoTable *info, StgClosure *p1, StgClosure *
{
bdescr *bd;
+ ASSERT( p1 != p2 ); \
bd = Bdescr((P_)p1);
if (bd->gen->no == 0) {
((StgInd *)p1)->indirectee = p2;