Commit 0ff0f54d authored by Victor Stinner's avatar Victor Stinner

Issue #18408: Fix call_function() of ceval.c to handle PyTuple_New() failure

(in load_args()), ex: MemoryError.
parent 9812af8e
...@@ -4171,10 +4171,15 @@ call_function(PyObject ***pp_stack, int oparg ...@@ -4171,10 +4171,15 @@ call_function(PyObject ***pp_stack, int oparg
else { else {
PyObject *callargs; PyObject *callargs;
callargs = load_args(pp_stack, na); callargs = load_args(pp_stack, na);
READ_TIMESTAMP(*pintr0); if (callargs != NULL) {
C_TRACE(x, PyCFunction_Call(func,callargs,NULL)); READ_TIMESTAMP(*pintr0);
READ_TIMESTAMP(*pintr1); C_TRACE(x, PyCFunction_Call(func,callargs,NULL));
Py_XDECREF(callargs); READ_TIMESTAMP(*pintr1);
Py_XDECREF(callargs);
}
else {
x = NULL;
}
} }
} else { } else {
if (PyMethod_Check(func) && PyMethod_GET_SELF(func) != NULL) { if (PyMethod_Check(func) && PyMethod_GET_SELF(func) != NULL) {
......
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