Commit 3048be77 authored by Stefan Behnel's avatar Stefan Behnel

Hard-disable the MergeVTables() step during the extension type setup when...

Hard-disable the MergeVTables() step during the extension type setup when using the Limited API. There might be a way to make it work, but it currently won't.

Also see https://github.com/cython/cython/pull/4107
parent f3f7b612
......@@ -5371,12 +5371,13 @@ class CClassDefNode(ClassDefNode):
typeobj_cname,
type.vtabptr_cname,
code.error_goto(entry.pos)))
code.putln("#endif")
# TODO: find a way to make this work with the Limited API!
code.globalstate.use_utility_code(
UtilityCode.load_cached('MergeVTables', 'ImportExport.c'))
code.putln("if (__Pyx_MergeVtables(&%s) < 0) %s" % (
typeobj_cname,
code.error_goto(entry.pos)))
code.putln("#endif")
if not type.scope.is_internal and not type.scope.directives.get('internal'):
# scope.is_internal is set for types defined by
# Cython (such as closures), the 'internal'
......
......@@ -748,10 +748,14 @@ bad:
/////////////// MergeVTables.proto ///////////////
//@requires: GetVTable
// TODO: find a way to make this work with the Limited API!
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type); /*proto*/
#endif
/////////////// MergeVTables ///////////////
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) {
int i;
void** base_vtables;
......@@ -808,6 +812,7 @@ bad:
free(base_vtables);
return -1;
}
#endif
/////////////// ImportNumPyArray.proto ///////////////
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment