From: Guillermo J. Rozas Date: Thu, 20 Aug 1992 04:28:39 +0000 (+0000) Subject: Fix an allocation bug. X-Git-Tag: 20090517-FFI~9095 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6d0530b7db9864d85c1ed2042590465927c858a2;p=mit-scheme.git Fix an allocation bug. --- diff --git a/v7/src/microcode/cmpintmd/mips.h b/v7/src/microcode/cmpintmd/mips.h index b9ff3bb4a..fe6ed202a 100644 --- a/v7/src/microcode/cmpintmd/mips.h +++ b/v7/src/microcode/cmpintmd/mips.h @@ -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;