Commit c98afb7a authored by Berker Peksag's avatar Berker Peksag

Issue #27587: Merge from 3.5

parents ad7b6c37 4b7b565c
......@@ -10,6 +10,10 @@ What's New in Python 3.6.0 beta 1
Core and Builtins
-----------------
- Issue #27587: Fix another issue found by PVS-Studio: Null pointer check
after use of 'def' in _PyState_AddModule().
Initial patch by Christian Heimes.
- Issue #27792: The modulo operation applied to ``bool`` and other
``int`` subclasses now always returns an ``int``. Previously
the return type depended on the input values. Patch by Xiang Zhang.
......
......@@ -285,14 +285,16 @@ int
_PyState_AddModule(PyObject* module, struct PyModuleDef* def)
{
PyInterpreterState *state;
if (!def) {
assert(PyErr_Occurred());
return -1;
}
if (def->m_slots) {
PyErr_SetString(PyExc_SystemError,
"PyState_AddModule called on module with slots");
return -1;
}
state = GET_INTERP_STATE();
if (!def)
return -1;
if (!state->modules_by_index) {
state->modules_by_index = PyList_New(0);
if (!state->modules_by_index)
......
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