Fix an allocation bug.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Thu, 20 Aug 1992 04:28:39 +0000 (04:28 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Thu, 20 Aug 1992 04:28:39 +0000 (04:28 +0000)
v7/src/microcode/cmpintmd/mips.h

index b9ff3bb4acefa23c3b882484051f4b92ddfdcfef..fe6ed202ad73520bcc71535a9bb57e0f4d562572 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpintmd/mips.h,v 1.12 1992/08/20 01:12:39 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpintmd/mips.h,v 1.13 1992/08/20 04:28:39 jinx Exp $
 
 Copyright (c) 1989-1992 Massachusetts Institute of Technology
 
@@ -551,6 +551,13 @@ DEFUN (allocate_closure, (size), long size)
   limit = ((SCHEME_OBJECT *) Registers[REGBLOCK_CLOSURE_LIMIT]);
   space =  ((limit - free_closure) + 3);
 
+  /* Bump up to a multiple of CLOSURE_ENTRY_WORDS.
+     Otherwise clearing by the allocation code may clobber
+     a different word.
+   */
+  size = (CLOSURE_ENTRY_WORDS
+         * ((size + (CLOSURE_ENTRY_WORDS - 1))
+            / CLOSURE_ENTRY_WORDS))
   if (size > space)
   {
     long chunk_size;