~ chicken-core (chicken-5) 766003feea6c12ee68b497a2a9ac4163b087f160


commit 766003feea6c12ee68b497a2a9ac4163b087f160
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Nov 16 10:37:14 2009 +0100
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Sat Nov 21 13:14:47 2009 +0100

    don't use backdoor to tinyclos for instance foreign type

diff --git a/support.scm b/support.scm
index 22a74b5e..51493735 100644
--- a/support.scm
+++ b/support.scm
@@ -1090,7 +1090,11 @@
      (cond 
        [(and (list? type) (= 3 (length type)) 
 	     (memq (car type) '(instance instance-ref)))
-	`(##tinyclos#make-instance-from-pointer ,body ,(caddr type)) ] ;XXX eggified, needs better treatment...
+	(let ((tmp (gensym)))
+	  `(let ((,tmp ,body))
+	     (and ,tmp
+		  (not (##sys#null-pointer? ,tmp))
+		  (make ,(caddr type) 'this ,tmp) ) ) ) ]
        [(and (list? type) (= 3 (length type)) (eq? 'nonnull-instance (car type)))
 	`(make ,(caddr type) 'this ,body) ]
        [else body] ) ] ) )
Trap