~ chicken-core (chicken-5) ab3f895fe7fd3ff84a1e38fef4d79349a699e0cd
commit ab3f895fe7fd3ff84a1e38fef4d79349a699e0cd 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 23 17:54:28 2009 +0100 don't use backdoor to tinyclos for instance foreign type Signed-off-by: felix <felix@call-with-current-continuation.org> 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