mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-47162: Add call trampoline to mitigate bad fpcasts on Emscripten (GH-32189)
This commit is contained in:
parent
795c00b91c
commit
581c4434de
8 changed files with 99 additions and 18 deletions
|
@ -102,7 +102,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
|
|||
const char *oldcontext;
|
||||
dl_funcptr exportfunc;
|
||||
PyModuleDef *def;
|
||||
PyObject *(*p0)(void);
|
||||
PyModInitFunction p0;
|
||||
|
||||
name_unicode = PyObject_GetAttrString(spec, "name");
|
||||
if (name_unicode == NULL) {
|
||||
|
@ -157,7 +157,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
|
|||
goto error;
|
||||
}
|
||||
|
||||
p0 = (PyObject *(*)(void))exportfunc;
|
||||
p0 = (PyModInitFunction)exportfunc;
|
||||
|
||||
/* Package context is needed for single-phase init */
|
||||
oldcontext = _Py_PackageContext;
|
||||
|
@ -166,7 +166,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
|
|||
_Py_PackageContext = oldcontext;
|
||||
goto error;
|
||||
}
|
||||
m = p0();
|
||||
m = _PyImport_InitFunc_TrampolineCall(p0);
|
||||
_Py_PackageContext = oldcontext;
|
||||
|
||||
if (m == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue