File: | src/BTrees/BTreeTemplate.c |
Function: | BTree_getstate |
Error: | ob_refcnt of '*r.255' is 1 too high |
960 static PyObject *
961 BTree_getstate(BTree *self)
962 {
when considering range: 3 <= value <= 127
taking False path
963 PyObject *r = NULL;
964 PyObject *o;
965 int i, l;
966
967 UNLESS (PER_USE(self)) return NULL;
when considering range: -128 <= value <= -2
taking True path
when considering range: -128 <= value <= -1
taking False path
taking False path
968
969 if (self->len) {
when considering range: -0x80000000 <= value <= -1
taking True path
970 r = PyTuple_New(self->len * 2 - 1);
when PyTuple_New() succeeds
PyTupleObject allocated at: r = PyTuple_New(self->len * 2 - 1);
ob_refcnt is now refs: 1 + N where N >= 0
971 if (r == NULL)
taking False path
972 goto err;
973
974 if (self->len == 1
when considering value == (int)1 from src/BTrees/BTreeTemplate.c:974
taking True path
975 && self->data->child->ob_type != self->ob_type
when treating unknown struct BTreeItem * from src/BTrees/BTreeTemplate.c:975 as non-NULL
when treating unknown struct Sized * from src/BTrees/BTreeTemplate.c:975 as non-NULL
when taking True path
976 #ifdef PERSISTENT
977 && BUCKET(self->data->child)->oid == NULL
when treating unknown struct BTreeItem * from src/BTrees/BTreeTemplate.c:977 as non-NULL
when treating unknown struct Sized * from src/BTrees/BTreeTemplate.c:977 as non-NULL
when treating unknown struct PyObject * from src/BTrees/BTreeTemplate.c:977 as non-NULL
taking False path
978 #endif
979 ) {
980 /* We have just one bucket. Save its data directly. */
981 o = bucket_getstate((Bucket *)self->data->child);
982 if (o == NULL)
983 goto err;
984 PyTuple_SET_ITEM(r, 0, o);
985 ASSIGN(r, Py_BuildValue("(O)", r));
986 }
987 else {
988 for (i=0, l=0; i < self->len; i++) {
when considering range: -0x80000000 <= value <= 0
taking False path
989 if (i) {
990 COPY_KEY_TO_OBJECT(o, self->data[i].key);
991 PyTuple_SET_ITEM(r, l, o);
992 l++;
993 }
994 o = (PyObject *)self->data[i].child;
995 Py_INCREF(o);
996 PyTuple_SET_ITEM(r,l,o);
997 l++;
998 }
999 ASSIGN(r, Py_BuildValue("OO", r, self->firstbucket));
when Py_BuildValue() succeeds
ob_refcnt is now refs: 1 + N where N >= 1
1000 }
1001
1002 }
1003 else {
1004 r = Py_None;
1005 Py_INCREF(r);
1006 }
1007
1008 PER_UNUSE(self);
when treating unknown struct cPersistenceCAPIstruct * from src/persistent/cPersistence.h:112 as non-NULL
calling unknown void (*) (struct cPersistentObject *) from src/BTrees/BTreeTemplate.c:1008
1009
1010 return r;
1011
1012 err:
1013 PER_UNUSE(self);
1014 Py_XDECREF(r);
1015 return NULL;
1016 }
ob_refcnt of '*r.255' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 14 similar trace(s) to this
File: | src/BTrees/BTreeTemplate.c |
Function: | BTree_getstate |
Error: | ob_refcnt of new ref from call to Py_BuildValue is 1 too high |
960 static PyObject *
961 BTree_getstate(BTree *self)
962 {
when considering range: 3 <= value <= 127
taking False path
963 PyObject *r = NULL;
964 PyObject *o;
965 int i, l;
966
967 UNLESS (PER_USE(self)) return NULL;
when considering range: -128 <= value <= -2
taking True path
when considering range: -128 <= value <= -1
taking False path
taking False path
968
969 if (self->len) {
when considering range: -0x80000000 <= value <= -1
taking True path
970 r = PyTuple_New(self->len * 2 - 1);
when PyTuple_New() succeeds
971 if (r == NULL)
taking False path
972 goto err;
973
974 if (self->len == 1
when considering value == (int)1 from src/BTrees/BTreeTemplate.c:974
taking True path
975 && self->data->child->ob_type != self->ob_type
when treating unknown struct BTreeItem * from src/BTrees/BTreeTemplate.c:975 as non-NULL
when treating unknown struct Sized * from src/BTrees/BTreeTemplate.c:975 as non-NULL
when taking True path
976 #ifdef PERSISTENT
977 && BUCKET(self->data->child)->oid == NULL
when treating unknown struct BTreeItem * from src/BTrees/BTreeTemplate.c:977 as non-NULL
when treating unknown struct Sized * from src/BTrees/BTreeTemplate.c:977 as non-NULL
when treating unknown struct PyObject * from src/BTrees/BTreeTemplate.c:977 as non-NULL
taking False path
978 #endif
979 ) {
980 /* We have just one bucket. Save its data directly. */
981 o = bucket_getstate((Bucket *)self->data->child);
982 if (o == NULL)
983 goto err;
984 PyTuple_SET_ITEM(r, 0, o);
985 ASSIGN(r, Py_BuildValue("(O)", r));
986 }
987 else {
988 for (i=0, l=0; i < self->len; i++) {
when considering range: -0x80000000 <= value <= 0
taking False path
989 if (i) {
990 COPY_KEY_TO_OBJECT(o, self->data[i].key);
991 PyTuple_SET_ITEM(r, l, o);
992 l++;
993 }
994 o = (PyObject *)self->data[i].child;
995 Py_INCREF(o);
996 PyTuple_SET_ITEM(r,l,o);
997 l++;
998 }
999 ASSIGN(r, Py_BuildValue("OO", r, self->firstbucket));
when Py_BuildValue() succeeds
new ref from call to Py_BuildValue allocated at: ASSIGN(r, Py_BuildValue("OO", r, self->firstbucket));
ob_refcnt is now refs: 1 + N where N >= 0
1000 }
1001
1002 }
1003 else {
1004 r = Py_None;
1005 Py_INCREF(r);
1006 }
1007
1008 PER_UNUSE(self);
when treating unknown struct cPersistenceCAPIstruct * from src/persistent/cPersistence.h:112 as non-NULL
calling unknown void (*) (struct cPersistentObject *) from src/BTrees/BTreeTemplate.c:1008
1009
1010 return r;
1011
1012 err:
1013 PER_UNUSE(self);
1014 Py_XDECREF(r);
1015 return NULL;
1016 }
ob_refcnt of new ref from call to Py_BuildValue is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 8 similar trace(s) to this