use type.as_argument_type() when adapting temp types, include C function types in...
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 18 Nov 2012 05:58:45 +0000 (06:58 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 18 Nov 2012 05:58:45 +0000 (06:58 +0100)
--HG--
extra : transplant_source : %01%22lN%B0%1D%B9h%AC%2B4%E1F%7FQ%15%E6%F3%F1%9F

Cython/Compiler/ExprNodes.py
Cython/Compiler/PyrexTypes.py

index 59bbd58..13fc0ef 100755 (executable)
@@ -9630,7 +9630,7 @@ class CoerceToTempNode(CoercionNode):
 
     def __init__(self, arg, env):
         CoercionNode.__init__(self, arg)
-        self.type = self.arg.type
+        self.type = self.arg.type.as_argument_type()
         self.constant_result = self.arg.constant_result
         self.is_temp = 1
         if self.type.is_pyobject:
index 4f97ec4..9fc3b46 100755 (executable)
@@ -174,7 +174,7 @@ class PyrexType(BaseType):
     #    as other_type.
     #
     #  as_argument_type():
-    #    Coerces array type into pointer type for use as
+    #    Coerces array and C function types into pointer type for use as
     #    a formal argument type.
     #
 
@@ -2417,6 +2417,9 @@ class CFuncType(CType):
         else:
             return ""
 
+    def as_argument_type(self):
+        return c_ptr_type(self)
+
     def same_c_signature_as(self, other_type, as_cmethod = 0):
         return self.same_c_signature_as_resolved_type(
             other_type.resolve(), as_cmethod)