mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Fix bug in specialization and make reification atomic
This commit is contained in:
parent
cdec6a6236
commit
c3b4807dac
2 changed files with 17 additions and 3 deletions
|
|
@ -1708,10 +1708,14 @@ specialize_load_global_lock_held(
|
|||
goto fail;
|
||||
}
|
||||
PyObject *value = NULL;
|
||||
if (PyDict_GetItemRef(globals, name, &value) < 0 ||
|
||||
(value != NULL && PyLazyImport_CheckExact(value))) {
|
||||
if (PyDict_GetItemRef(globals, name, &value) < 0) {
|
||||
SPECIALIZATION_FAIL(LOAD_GLOBAL, SPEC_FAIL_EXPECTED_ERROR);
|
||||
goto fail;
|
||||
}
|
||||
if (value != NULL && PyLazyImport_CheckExact(value)) {
|
||||
SPECIALIZATION_FAIL(LOAD_GLOBAL, SPEC_FAIL_ATTR_MODULE_LAZY_VALUE);
|
||||
Py_DECREF(value);
|
||||
goto fail;
|
||||
}
|
||||
Py_XDECREF(value);
|
||||
Py_ssize_t index = _PyDictKeys_StringLookup(globals_keys, name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue