summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-08 20:27:42 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-08 20:27:42 (GMT)
commit0ff0f54dd498170d5698132d24deeeaaab9bf5df (patch)
tree71596aee9ad338c70dae4198c6e3a9e4e8069016 /Python/ceval.c
parent9812af8e727ee38f6526d377d84fb7f4507e23bc (diff)
downloadcpython-0ff0f54dd498170d5698132d24deeeaaab9bf5df.zip
cpython-0ff0f54dd498170d5698132d24deeeaaab9bf5df.tar.gz
cpython-0ff0f54dd498170d5698132d24deeeaaab9bf5df.tar.bz2
Issue #18408: Fix call_function() of ceval.c to handle PyTuple_New() failure
(in load_args()), ex: MemoryError.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index e184ef6..82e85ca 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4171,10 +4171,15 @@ call_function(PyObject ***pp_stack, int oparg
else {
PyObject *callargs;
callargs = load_args(pp_stack, na);
- READ_TIMESTAMP(*pintr0);
- C_TRACE(x, PyCFunction_Call(func,callargs,NULL));
- READ_TIMESTAMP(*pintr1);
- Py_XDECREF(callargs);
+ if (callargs != NULL) {
+ READ_TIMESTAMP(*pintr0);
+ C_TRACE(x, PyCFunction_Call(func,callargs,NULL));
+ READ_TIMESTAMP(*pintr1);
+ Py_XDECREF(callargs);
+ }
+ else {
+ x = NULL;
+ }
}
} else {
if (PyMethod_Check(func) && PyMethod_GET_SELF(func) != NULL) {