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): ...@@ -5371,12 +5371,13 @@ class CClassDefNode(ClassDefNode):
typeobj_cname, typeobj_cname,
type.vtabptr_cname, type.vtabptr_cname,
code.error_goto(entry.pos))) 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( code.globalstate.use_utility_code(
UtilityCode.load_cached('MergeVTables', 'ImportExport.c')) UtilityCode.load_cached('MergeVTables', 'ImportExport.c'))
code.putln("if (__Pyx_MergeVtables(&%s) < 0) %s" % ( code.putln("if (__Pyx_MergeVtables(&%s) < 0) %s" % (
typeobj_cname, typeobj_cname,
code.error_goto(entry.pos))) code.error_goto(entry.pos)))
code.putln("#endif")
if not type.scope.is_internal and not type.scope.directives.get('internal'): if not type.scope.is_internal and not type.scope.directives.get('internal'):
# scope.is_internal is set for types defined by # scope.is_internal is set for types defined by
# Cython (such as closures), the 'internal' # Cython (such as closures), the 'internal'
......
...@@ -748,10 +748,14 @@ bad: ...@@ -748,10 +748,14 @@ bad:
/////////////// MergeVTables.proto /////////////// /////////////// MergeVTables.proto ///////////////
//@requires: GetVTable //@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*/ static int __Pyx_MergeVtables(PyTypeObject *type); /*proto*/
#endif
/////////////// MergeVTables /////////////// /////////////// MergeVTables ///////////////
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) { static int __Pyx_MergeVtables(PyTypeObject *type) {
int i; int i;
void** base_vtables; void** base_vtables;
...@@ -808,6 +812,7 @@ bad: ...@@ -808,6 +812,7 @@ bad:
free(base_vtables); free(base_vtables);
return -1; return -1;
} }
#endif
/////////////// ImportNumPyArray.proto /////////////// /////////////// 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