mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Fix for 838140: don't call NSUnlinkModule when we fail to find our
expected entrypoint. The unlinking will crash the application if the module contained ObjC code. The price of this is small: a little wasted memory, and only in a case than isn't expected to occur often.
This commit is contained in:
parent
ad1654e03a
commit
e497978201
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
||||||
#ifdef USE_DYLD_GLOBAL_NAMESPACE
|
#ifdef USE_DYLD_GLOBAL_NAMESPACE
|
||||||
if (!NSIsSymbolNameDefined(funcname)) {
|
if (!NSIsSymbolNameDefined(funcname)) {
|
||||||
/* UnlinkModule() isn't implemented in current versions, but calling it does no harm */
|
/* UnlinkModule() isn't implemented in current versions, but calling it does no harm */
|
||||||
NSUnLinkModule(newModule, FALSE);
|
/* NSUnLinkModule(newModule, FALSE); removed: causes problems for ObjC code */
|
||||||
PyErr_Format(PyExc_ImportError,
|
PyErr_Format(PyExc_ImportError,
|
||||||
"Loaded module does not contain symbol %.200s",
|
"Loaded module does not contain symbol %.200s",
|
||||||
funcname);
|
funcname);
|
||||||
|
@ -102,7 +102,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
||||||
#else
|
#else
|
||||||
theSym = NSLookupSymbolInModule(newModule, funcname);
|
theSym = NSLookupSymbolInModule(newModule, funcname);
|
||||||
if ( theSym == NULL ) {
|
if ( theSym == NULL ) {
|
||||||
NSUnLinkModule(newModule, FALSE);
|
/* NSUnLinkModule(newModule, FALSE); removed: causes problems for ObjC code */
|
||||||
PyErr_Format(PyExc_ImportError,
|
PyErr_Format(PyExc_ImportError,
|
||||||
"Loaded module does not contain symbol %.200s",
|
"Loaded module does not contain symbol %.200s",
|
||||||
funcname);
|
funcname);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue