recordMutable: test for gen>0 before calling recordMutableCap
authorSimon Marlow <simonmar@microsoft.com>
Wed, 17 Oct 2007 12:56:57 +0000 (12:56 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 17 Oct 2007 12:56:57 +0000 (12:56 +0000)
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#.

includes/Cmm.h

index cecf926..715d2b2 100644 (file)
   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 */