From 0b39291dbdeb03b9d49650b4864886a6fcd9172c Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sat, 2 Apr 2005 02:25:29 +0000 Subject: [PATCH] . original commit: 63cdc235afd35d1f5a4ca6452764697a2cc5c378 --- collects/mzlib/foreign.ss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collects/mzlib/foreign.ss b/collects/mzlib/foreign.ss index 770c54b..6eb84ba 100644 --- a/collects/mzlib/foreign.ss +++ b/collects/mzlib/foreign.ss @@ -999,9 +999,9 @@ (provide TAG? TAG-length) (provide (rename allocate-TAG make-TAG)) (define (allocate-TAG n . init) - (let* ([p (malloc n type)] + (let* ([p (if (eq? n 0) #f (malloc n type))] [v (make-TAG p n)]) - (when (pair? init) + (when (and p (pair? init)) (let ([init (car init)]) (let loop ([i (sub1 n)]) (unless (< i 0)