[Python-checkins] python/dist/src/Modules gcmodule.c,2.39,2.40

tim_one@sourceforge.net tim_one@sourceforge.net
Sat, 27 Apr 2002 18:57:28 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv979

Modified Files:
	gcmodule.c 
Log Message:
_PyObject_GC_New:  Could call PyObject_INIT with a NULL 1st argument.
_PyObject_GC_NewVar:  Could call PyObject_INIT_VAR likewise.

Bugfix candidate.


Index: gcmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v
retrieving revision 2.39
retrieving revision 2.40
diff -C2 -d -r2.39 -r2.40
*** gcmodule.c	12 Apr 2002 02:41:03 -0000	2.39
--- gcmodule.c	28 Apr 2002 01:57:25 -0000	2.40
***************
*** 879,883 ****
  {
  	PyObject *op = _PyObject_GC_Malloc(_PyObject_SIZE(tp));
! 	return PyObject_INIT(op, tp);
  }
  
--- 879,885 ----
  {
  	PyObject *op = _PyObject_GC_Malloc(_PyObject_SIZE(tp));
! 	if (op != NULL)
! 		op = PyObject_INIT(op, tp);
! 	return op;
  }
  
***************
*** 887,891 ****
  	const size_t size = _PyObject_VAR_SIZE(tp, nitems);
  	PyVarObject *op = (PyVarObject *) _PyObject_GC_Malloc(size);
! 	return PyObject_INIT_VAR(op, tp, nitems);
  }
  
--- 889,895 ----
  	const size_t size = _PyObject_VAR_SIZE(tp, nitems);
  	PyVarObject *op = (PyVarObject *) _PyObject_GC_Malloc(size);
! 	if (op != NULL)
! 		op = PyObject_INIT_VAR(op, tp, nitems);
! 	return op;
  }