Mercurial > cpython-lru_cache-weakref
comparison Python/Python-ast.c @ 84856:ad90fc28769a
Issue #18552: Check return value of PyArena_AddPyObject() in obj2ast_object().
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Sat, 27 Jul 2013 00:33:35 +0200 |
| parents | 9d26379db328 65121aa79ab3 |
| children | 142c62a490ce |
comparison
equal
deleted
inserted
replaced
| 84853:9d26379db328 | 84856:ad90fc28769a |
|---|---|
| 702 | 702 |
| 703 static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) | 703 static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) |
| 704 { | 704 { |
| 705 if (obj == Py_None) | 705 if (obj == Py_None) |
| 706 obj = NULL; | 706 obj = NULL; |
| 707 if (obj) | 707 if (obj) { |
| 708 PyArena_AddPyObject(arena, obj); | 708 if (PyArena_AddPyObject(arena, obj) < 0) { |
| 709 Py_XINCREF(obj); | 709 *out = NULL; |
| 710 return -1; | |
| 711 } | |
| 712 Py_INCREF(obj); | |
| 713 } | |
| 710 *out = obj; | 714 *out = obj; |
| 711 return 0; | 715 return 0; |
| 712 } | 716 } |
| 713 | 717 |
| 714 static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena) | 718 static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena) |
