~ chicken-core (chicken-5) 5b09da9117edcc3c80d45d1ef08b788bed42ddf1
commit 5b09da9117edcc3c80d45d1ef08b788bed42ddf1
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: Mon Nov 16 10:37:14 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