Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler crash for mismatch in property names #1905

Closed
realead opened this issue Oct 2, 2017 · 1 comment
Closed

compiler crash for mismatch in property names #1905

realead opened this issue Oct 2, 2017 · 1 comment

Comments

@realead
Copy link
Contributor

realead commented Oct 2, 2017

For this file with an obvious typo:

#crash.pyx
cdef class PyResult:
    cdef int add
    @property
    def add(self):
        return self.add
    @add.setter
    def mult(self, value): ### here we go, should be add
        self.add = value

The following crash happens:


>> python --version
Python 2.7.12
>> python -m cython --version 
Cython version 0.27.1
>> python -m cython crash.pyx
Error compiling Cython file:
------------------------------------------------------------
...
    cdef int add
    @property
    def add(self):
        return self.add
    @add.setter
    def mult(self, value):
   ^
------------------------------------------------------------

crash.pyx:7:4: Compiler crash in DecoratorTransform

ModuleNode.body = StatListNode(crash.pyx:1:5)
StatListNode.stats[0] = CClassDefNode(crash.pyx:1:5,
    as_name = u'PyResult',
    class_name = u'PyResult',
    module_name = u'',
    visibility = u'private')
CClassDefNode.body = StatListNode(crash.pyx:2:4)
StatListNode.stats[2] = DefNode(crash.pyx:7:4,
    modifiers = [...]/0,
    name = u'mult',
    num_required_args = 2,
    py_wrapper_required = True,
    reqd_kw_flags_cname = '0')

Compiler crash traceback from this point on:
  File "Cython/Compiler/Visitor.py", line 180, in Cython.Compiler.Visitor.TreeVisitor._visit
    return handler_method(obj)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/ParseTreeTransforms.py", line 1388, in visit_DefNode
    assert decorator.obj.name == node.name
AssertionError: 

@scoder scoder closed this as completed in 1d37f2a Oct 3, 2017
@scoder
Copy link
Contributor

scoder commented Oct 3, 2017

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants