-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
AttributeError: 'CppClassType' object has no attribute 'vtabptr_cname' #2167
Comments
The crash disappears if I remove the default argument values, i.e. if I turn the method declaration to:
|
I bumped into this problem today as well. Here's a minimal reproducer, using the Cython magic for IPython: In [1]: %load_ext cython
In [2]: %%cython -+
...: cdef extern from *:
...: cdef cppclass SomeClass:
...: @staticmethod
...: void func(int a, int b=0)
...:
...: SomeClass.func(1,2)
...:
...: That results in: Error compiling Cython file:
------------------------------------------------------------
...
cdef extern from *:
cdef cppclass SomeClass:
@staticmethod
void func(int a, int b=0)
SomeClass.func(1,2)
^
------------------------------------------------------------
.cache/ipython/cython/_cython_magic_c961a377a1670543c84a8818f0ec9563.pyx:6:9: Compiler crash in AnalyseExpressionsTransform
File 'Nodes.py', line 435, in analyse_expressions: StatListNode(_cython_magic_c961a377a1670543c84a8818f0ec9563.pyx:1:0)
File 'Nodes.py', line 5138, in analyse_expressions: ExprStatNode(_cython_magic_c961a377a1670543c84a8818f0ec9563.pyx:6:14)
File 'ExprNodes.py', line 587, in analyse_expressions: SimpleCallNode(_cython_magic_c961a377a1670543c84a8818f0ec9563.pyx:6:14,
analysed = True,
use_managed_ref = True)
File 'ExprNodes.py', line 5546, in analyse_types: SimpleCallNode(_cython_magic_c961a377a1670543c84a8818f0ec9563.pyx:6:14,
analysed = True,
use_managed_ref = True)
File 'ExprNodes.py', line 6881, in analyse_types: AttributeNode(_cython_magic_c961a377a1670543c84a8818f0ec9563.pyx:6:9,
attribute = 'func',
initialized_check = True,
is_attribute = 1,
is_called = 1,
needs_none_check = True,
result_is_used = True,
use_managed_ref = True)
File 'ExprNodes.py', line 6942, in analyse_as_type_attribute: AttributeNode(_cython_magic_c961a377a1670543c84a8818f0ec9563.pyx:6:9,
attribute = 'func',
initialized_check = True,
is_attribute = 1,
is_called = 1,
needs_none_check = True,
result_is_used = True,
use_managed_ref = True)
Compiler crash traceback from this point on:
File "/home/mwoznisk/.local/lib/python3.8/site-packages/Cython/Compiler/ExprNodes.py", line 6942, in analyse_as_type_attribute
cname = "%s->%s" % (type.vtabptr_cname, entry.cname)
AttributeError: 'CppClassType' object has no attribute 'vtabptr_cname' |
Still reproduces with cython 3.0.2. |
Still reproduces after the changes in #3235. |
This is with 0.28.1. The
CArrayData
class is declared as follows:When trying to compile the given code:
Cython crashes with the following error:
The text was updated successfully, but these errors were encountered: