[Python-checkins] python/dist/src/Python asdl.c,1.1.2.4,1.1.2.5
nnorwitz@users.sourceforge.net
nnorwitz@users.sourceforge.net
Wed, 02 Apr 2003 16:55:03 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv26182/Python
Modified Files:
Tag: ast-branch
asdl.c
Log Message:
Need to set PyExc_MemoryError after PyObject_Malloc fails
Index: asdl.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/asdl.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** asdl.c 3 Apr 2003 00:49:02 -0000 1.1.2.4
--- asdl.c 3 Apr 2003 00:55:00 -0000 1.1.2.5
***************
*** 7,12 ****
asdl_seq *seq = (asdl_seq *)PyObject_Malloc(sizeof(asdl_seq)
+ sizeof(void *) * (size - 1));
! if (!seq)
return NULL;
seq->size = size;
seq->offset = 0;
--- 7,14 ----
asdl_seq *seq = (asdl_seq *)PyObject_Malloc(sizeof(asdl_seq)
+ sizeof(void *) * (size - 1));
! if (!seq) {
! PyErr_SetString(PyExc_MemoryError, "no memory");
return NULL;
+ }
seq->size = size;
seq->offset = 0;