summaryrefslogtreecommitdiff
path: root/ghc/includes/Stable.h
diff options
context:
space:
mode:
authorsimonmar <unknown>2000-09-04 15:09:49 +0000
committersimonmar <unknown>2000-09-04 15:09:49 +0000
commit4c0ca9cf79b66fb6048b409e80b5868366358cdb (patch)
tree112ad070796b5958aa581b79e3d41806035a8b4b /ghc/includes/Stable.h
parenta7eae667e4d5bbcf7415a78c71e07b3b1d65ae7b (diff)
downloadhaskell-4c0ca9cf79b66fb6048b409e80b5868366358cdb.tar.gz
[project @ 2000-09-04 15:09:49 by simonmar]
Fix a bug in freeStablePtr, the weight being subtracted from the entry in the stable pointer table was wrong.
Diffstat (limited to 'ghc/includes/Stable.h')
-rw-r--r--ghc/includes/Stable.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/ghc/includes/Stable.h b/ghc/includes/Stable.h
index c8685045d5..d3dfb589a0 100644
--- a/ghc/includes/Stable.h
+++ b/ghc/includes/Stable.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Stable.h,v 1.5 2000/04/13 15:37:11 panne Exp $
+ * $Id: Stable.h,v 1.6 2000/09/04 15:09:49 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -48,7 +48,8 @@ freeStablePtr(StgStablePtr sp)
&& stable_ptr_table[sn].addr != NULL
&& stable_ptr_table[sn].weight > 0);
- stable_ptr_table[sn].weight += (stgCast(StgWord,sp) & STABLEPTR_WEIGHT_MASK) >> STABLEPTR_WEIGHT_SHIFT;
+ stable_ptr_table[sn].weight +=
+ 1 << ((((StgWord)sp & STABLEPTR_WEIGHT_MASK) >> STABLEPTR_WEIGHT_SHIFT) - 1);
}
extern inline StgStablePtr