summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorda-woods <dw-git@d-woods.co.uk>2020-07-29 06:23:44 +0100
committerGitHub <noreply@github.com>2020-07-29 07:23:44 +0200
commit12a2ad5a090637248200563f4659a583664b70db (patch)
tree5962e119998e3055a8c9e7d2fc52bea05204f196
parent5d8527d196c2ffd45b345ae31cac856f0c8fdc07 (diff)
downloadcython-12a2ad5a090637248200563f4659a583664b70db.tar.gz
Don't create CReference in C (only c++) (GH-3746)
-rw-r--r--Cython/Compiler/ExprNodes.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 3a2c4cb1b..9c3dd3952 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -10346,7 +10346,10 @@ class DereferenceNode(CUnopNode):
def analyse_c_operation(self, env):
if self.operand.type.is_ptr:
- self.type = PyrexTypes.CReferenceType(self.operand.type.base_type)
+ if env.is_cpp:
+ self.type = PyrexTypes.CReferenceType(self.operand.type.base_type)
+ else:
+ self.type = self.operand.type.base_type
else:
self.type_error()