summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-10-17 12:56:57 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-10-17 12:56:57 +0000
commit3c58884ef36418f93dc1892125629df73e5d2a79 (patch)
tree4ccdd763334e2d6b60f0be0a6c79f1549cf9dc03 /includes
parentc9aa9bb5a8a1c5d80b4ec4a186bea3a3f00142cc (diff)
downloadhaskell-3c58884ef36418f93dc1892125629df73e5d2a79.tar.gz
recordMutable: test for gen>0 before calling recordMutableCap
For some reason the C-- version of recordMutable wasn't verifying that the object was in an old generation before attempting to add it to the mutable list, and this broke maessen_hashtab. This version of recordMutable is only used in unsafeThaw#.
Diffstat (limited to 'includes')
-rw-r--r--includes/Cmm.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h
index cecf92640b..715d2b2b0f 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -571,9 +571,13 @@
W_[free] = p; \
bdescr_free(__bd) = free + WDS(1);
-#define recordMutable(p, regs) \
- W_ __p; \
- __p = p; \
- recordMutableCap(__p, TO_W_(bdescr_gen_no(Bdescr(__p))), regs)
+#define recordMutable(p, regs) \
+ W_ __p; \
+ W_ __bd; \
+ W_ __gen; \
+ __p = p; \
+ __bd = Bdescr(__p); \
+ __gen = TO_W_(bdescr_gen_no(__bd)); \
+ if (__gen > 0) { recordMutableCap(__p, __gen, regs); }
#endif /* CMM_H */