From: Robert Bradshaw Date: Thu, 3 Apr 2008 03:55:29 +0000 (-0700) Subject: Allow ctypedef my_struct_s my_struct_t[1] trick, can access members of my_struct_t... X-Git-Tag: 0.9.6.14~29^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ed76a7c3398de8d34fe9877206038eed40958e81;p=cython.git Allow ctypedef my_struct_s my_struct_t[1] trick, can access members of my_struct_t as if it were a pointer. --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index e5273e34..ab3d891b 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1831,7 +1831,7 @@ class AttributeNode(ExprNode): self.entry = entry.as_variable self.analyse_as_python_attribute(env) return self - return AtomicExprNode.coerce_to(self, dst_type, env) + return ExprNode.coerce_to(self, dst_type, env) def compile_time_value(self, denv): attr = self.attribute @@ -1948,7 +1948,7 @@ class AttributeNode(ExprNode): if self.obj.type.is_string: self.obj = self.obj.coerce_to_pyobject(env) obj_type = self.obj.type - if obj_type.is_ptr: + if obj_type.is_ptr or obj_type.is_array: obj_type = obj_type.base_type self.op = "->" elif obj_type.is_extension_type: