Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e995622

Browse files
committed
when creating temps for C arrays and C functions, use to their respective pointer type
1 parent 34478b2 commit e995622

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Cython/Compiler/ExprNodes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9705,7 +9705,12 @@ class CoerceToTempNode(CoercionNode):
97059705

97069706
def __init__(self, arg, env):
97079707
CoercionNode.__init__(self, arg)
9708-
self.type = self.arg.type
9708+
temp_type = self.arg.type
9709+
if temp_type.is_array:
9710+
temp_type = PyrexTypes.c_ptr_type(temp_type.base_type)
9711+
elif temp_type.is_cfunction:
9712+
temp_type = PyrexTypes.c_ptr_type(temp_type)
9713+
self.type = temp_type
97099714
self.constant_result = self.arg.constant_result
97109715
self.is_temp = 1
97119716
if self.type.is_pyobject:

0 commit comments

Comments
 (0)