[project @ 2000-03-30 15:35:13 by simonmar]
authorsimonmar <unknown>
Thu, 30 Mar 2000 15:35:13 +0000 (15:35 +0000)
committersimonmar <unknown>
Thu, 30 Mar 2000 15:35:13 +0000 (15:35 +0000)
Add an ASSERT to catch a known bug: when allocating an AP_UPD in
raiseAsync, if the object is larger than a block in size then all
sorts of things can go wrong.

ghc/rts/Schedule.c

index 869b2ab..4ff4ef3 100644 (file)
@@ -1,5 +1,5 @@
 /* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.57 2000/03/20 09:42:50 andy Exp $
+ * $Id: Schedule.c,v 1.58 2000/03/30 15:35:13 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -2229,6 +2229,11 @@ raiseAsync(StgTSO *tso, StgClosure *exception)
      */
     ap = (StgAP_UPD *)allocate(AP_sizeW(words));
     
+    /* ToDo: allocating an AP_UPD more than a block in size doesn't
+     * work, and will cause the GC to break later on.
+     */
+    ASSERT(AP_sizeW(words) <= BLOCK_SIZE_W);
+
     ASSERT(words >= 0);
     
     ap->n_args = words;