Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Handle properly memory allocation failures on float operations in the
bytecode opcodes. Patch by Victor Stinner.
6 changes: 5 additions & 1 deletion Objects/floatobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ _PyStackRef _PyFloat_FromDouble_ConsumeInputs(_PyStackRef left, _PyStackRef righ
{
PyStackRef_CLOSE_SPECIALIZED(left, _PyFloat_ExactDealloc);
PyStackRef_CLOSE_SPECIALIZED(right, _PyFloat_ExactDealloc);
return PyStackRef_FromPyObjectSteal(PyFloat_FromDouble(value));
PyObject *obj = PyFloat_FromDouble(value);
if (obj == NULL) {
return PyStackRef_NULL;
}
return PyStackRef_FromPyObjectSteal(obj);
}

static PyObject *
Expand Down
Loading