From 17e2c9f91cdc029f9e3afd9134b652f91814a6de Mon Sep 17 00:00:00 2001
From: Jeremy Hughes <jedahu@gmail.com>
Date: Wed, 15 Jul 2009 16:42:45 +1200
Subject: [PATCH] alien.marshall.private: fix ptr-pass-through

---
 extra/alien/marshall/private/private.factor | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/extra/alien/marshall/private/private.factor b/extra/alien/marshall/private/private.factor
index 8eb3702135..70b03e2bab 100644
--- a/extra/alien/marshall/private/private.factor
+++ b/extra/alien/marshall/private/private.factor
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.inline arrays
 combinators fry functors kernel lexer libc macros math
-sequences specialized-arrays.alien libc.private ;
+sequences specialized-arrays.alien libc.private
+combinators.short-circuit ;
 IN: alien.marshall.private
 
 : bool>arg ( ? -- 1/0/obj )
@@ -16,7 +17,7 @@ MACRO: marshall-x* ( num-quot seq-quot -- alien )
     '[ bool>arg dup number? _ _ if ] ;
 
 : ptr-pass-through ( obj quot -- alien )
-    over c-ptr? [ drop ] [ call ] if ; inline
+    over { [ c-ptr? ] [ ] } 1&& [ drop ] [ call ] if ; inline
 
 : malloc-underlying ( obj -- alien )
     underlying>> malloc-byte-array ;