comparison Python/Python-ast.c @ 84855:65121aa79ab3 3.3

Issue #18552: Check return value of PyArena_AddPyObject() in obj2ast_object().
author Christian Heimes <christian@cheimes.de>
date Sat, 27 Jul 2013 00:33:13 +0200
parents d14f40c87438
children ad90fc28769a
comparison
equal deleted inserted replaced
84852:d14f40c87438 84855:65121aa79ab3
686 686
687 static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) 687 static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
688 { 688 {
689 if (obj == Py_None) 689 if (obj == Py_None)
690 obj = NULL; 690 obj = NULL;
691 if (obj) 691 if (obj) {
692 PyArena_AddPyObject(arena, obj); 692 if (PyArena_AddPyObject(arena, obj) < 0) {
693 Py_XINCREF(obj); 693 *out = NULL;
694 return -1;
695 }
696 Py_INCREF(obj);
697 }
694 *out = obj; 698 *out = obj;
695 return 0; 699 return 0;
696 } 700 }
697 701
698 static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena) 702 static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena)