Don't use ASSQ with all interrupts off -- it can generate an unbounded
authorChris Hanson <org/chris-hanson/cph>
Fri, 22 Jun 2007 02:27:48 +0000 (02:27 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 22 Jun 2007 02:27:48 +0000 (02:27 +0000)
amount of garbage and overflow the heap.

v7/src/compiler/base/crsend.scm

index bd86045829e9136f83eda8aa9c3009410906b24c..a38a6b74ec11c65344dc46338af82311deefd6a1 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: crsend.scm,v 1.18 2007/06/14 17:39:26 cph Exp $
+$Id: crsend.scm,v 1.19 2007/06/22 02:27:48 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -109,14 +109,16 @@ USA.
           (map (lambda (label)
                  (cons
                   label
-                  (with-absolutely-no-interrupts
-                    (lambda ()
-                      ((ucode-primitive primitive-object-set-type)
-                       (ucode-type compiled-entry)
-                       (make-non-pointer-object
-                        (+ (cdr (or (assq label label-bindings)
-                                    (error "Missing entry point" label)))
-                           (object-datum code-vector))))))))
+                  (let ((offset
+                         (cdr (or (assq label label-bindings)
+                                  (error "Missing entry point" label)))))
+                    (with-absolutely-no-interrupts
+                      (lambda ()
+                        ((ucode-primitive primitive-object-set-type)
+                         (ucode-type compiled-entry)
+                         (make-non-pointer-object
+                          (+ offset
+                             (object-datum code-vector)))))))))
                (cc-vector/entry-points cc-vector)))))
     (let ((label->expression
           (lambda (label)