[Cython] Compiler crash in AnalyseExpressionsTransform

Michael Enßlin michael at ensslin.cc
Fri Jun 12 12:51:00 CEST 2015


Hi,

another bug report:


mic at mic /tmp $ cat t11.pyx
cdef cppclass foo:
    pass

def test():
    foo()



mic at mic /tmp $ cython --cplus t11.pyx

Error compiling Cython file:
------------------------------------------------------------
...
cdef cppclass foo:
    pass

def test():
    foo()
      ^
------------------------------------------------------------

t11.pyx:5:7: Compiler crash in AnalyseExpressionsTransform

ModuleNode.body = StatListNode(t11.pyx:1:0)
StatListNode.stats[1] = DefNode(t11.pyx:4:0,
    modifiers = [...]/0,
    name = u'test',
    py_wrapper_required = True,
    reqd_kw_flags_cname = '0',
    used = True)
File 'Nodes.py', line 421, in analyse_expressions: StatListNode(t11.pyx:5:7)
File 'Nodes.py', line 4652, in analyse_expressions:
ExprStatNode(t11.pyx:5:7)
File 'ExprNodes.py', line 434, in analyse_expressions:
SimpleCallNode(t11.pyx:5:7,
    use_managed_ref = True)
File 'ExprNodes.py', line 4495, in analyse_types:
SimpleCallNode(t11.pyx:5:7,
    use_managed_ref = True)
File 'ExprNodes.py', line 4429, in analyse_as_type_constructor:
SimpleCallNode(t11.pyx:5:7,
    use_managed_ref = True)

Compiler crash traceback from this point on:
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/ExprNodes.py",
line 4429, in analyse_as_type_constructor
    self.function = RawCNameExprNode(self.function.pos, constructor.type)
AttributeError: 'NoneType' object has no attribute 'type'



The code  is obviously nonsensical, but Cython should produce a proper
error message instead of crashing.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20150612/85f564d4/attachment.sig>


More information about the cython-devel mailing list