[Cython] inline defnode calls

mark florisson markflorisson88 at gmail.com
Tue Jan 24 21:58:13 CET 2012

I just noticed the inline defnode call code. When I try to compile
with 'cython -Xoptimize.inline_defnode_calls=True test.pyx' with the
following code:

def foo(x): print foo

I get

Error compiling Cython file:
def foo(x):
    print x


test.pyx:4:3: Compiler crash in InlineDefNodeCalls

ModuleNode.body = StatListNode(test.pyx:1:0)
StatListNode.stats[2] = ExprStatNode(test.pyx:4:3)
ExprStatNode.expr = SimpleCallNode(test.pyx:4:3,
    result_is_used = True,
    use_managed_ref = True)

Compiler crash traceback from this point on:
  File "/Users/mark/cy/Cython/Compiler/Visitor.py", line 176, in _visitchild
    result = handler_method(child)
  File "/Users/mark/cy/Cython/Compiler/Optimize.py", line 1656, in
    if not function_name.cf_state.is_single:
AttributeError: 'NoneType' object has no attribute 'is_single'

More information about the cython-devel mailing list