Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix #682: compiler crash on auto_cpdef redefinition

  • Loading branch information...
commit 37d4884476b43b38536d47190a24e2d67f9252cf 1 parent 350afca
Stefan Behnel authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 Cython/Compiler/ParseTreeTransforms.py
View
6 Cython/Compiler/ParseTreeTransforms.py
@@ -1399,7 +1399,8 @@ def visit_PyClassDefNode(self, node):
return self.visit_CClassDefNode(node.as_cclass(), pxd_def)
else:
error(node.pos, "'%s' redeclared" % node.name)
- error(pxd_def.pos, "previous declaration here")
+ if pxd_def.pos:
+ error(pxd_def.pos, "previous declaration here")
return None
else:
return node
@@ -1420,7 +1421,8 @@ def visit_DefNode(self, node):
if pxd_def:
if not pxd_def.is_cfunction:
error(node.pos, "'%s' redeclared" % node.name)
- error(pxd_def.pos, "previous declaration here")
+ if pxd_def.pos:
+ error(pxd_def.pos, "previous declaration here")
return None
node = node.as_cfunction(pxd_def)
elif self.scope.is_module_scope and self.directives['auto_cpdef']:
Please sign in to comment.
Something went wrong with that request. Please try again.