commit 32667b73f1881c6486b6b6f07e7f296cad970c4e
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Feb 28 17:11:39 2012 -0500
cpychecker: update RefcountValue equality to exclude cases prevented by the external value
Update RefcountValue.eval_comparison('eq', rhs) to use get_min_value() rather
than relvalue, thus taking self.min_external into account.
This fixes some cases where the checker erroneously considered the case
of a deallocation by:
Py_DECREF(obj)
where "obj" provably had other references not owned by the function being
analyzed, and thus for the case where obj->ob_refcnt > 1 the deallocation
could not happen.
libcpychecker/refcounts.py | 2 +-
.../refcounts/PyDict_SetItem/correct/stdout.txt | 119 +++-----------------
.../refcounts/PyDict_SetItem/incorrect/stdout.txt | 109 +++----------------
.../PyDict_SetItemString/correct/stdout.txt | 48 +-------
.../refcounts/PySys_SetObject/correct/stdout.txt | 37 +------
.../Py_BuildValue/correct-code-O/stdout.txt | 37 +------
tests/cpychecker/refcounts/loop_n_times/stdout.txt | 47 +-------
.../refcounts/object_from_callback/stdout.txt | 99 +++--------------
8 files changed, 66 insertions(+), 432 deletions(-)
---
diff --git a/libcpychecker/refcounts.py b/libcpychecker/refcounts.py
index 1318ad8..4a47e59 100644
--- a/libcpychecker/refcounts.py
+++ b/libcpychecker/refcounts.py
@@ -177,7 +177,7 @@ class RefcountValue(AbstractValue):
if isinstance(rhs, ConcreteValue):
log('comparing refcount value %s with concrete value: %s', self, rhs)
# The actual value of ob_refcnt >= lhs.relvalue
- if self.relvalue > rhs.value:
+ if self.get_min_value() > rhs.value:
# (Equality is thus not possible for this case)
return False
diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/correct/stdout.txt b/tests/cpychecker/refcounts/PyDict_SetItem/correct/stdout.txt
index 992f4d9..f83eb4f 100644
--- a/tests/cpychecker/refcounts/PyDict_SetItem/correct/stdout.txt
+++ b/tests/cpychecker/refcounts/PyDict_SetItem/correct/stdout.txt
@@ -9,7 +9,7 @@ Trace 0:
'when PyDict_SetItem() succeeds'
'taking False path'
'when taking True path'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)))
@@ -49,51 +49,9 @@ Trace 1:
'taking False path'
'when PyDict_SetItem() succeeds'
'taking False path'
- 'when taking True path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)))
- str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type')))
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38
- r->ob_refcnt: refs: 0 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type')))
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:28
-
-Trace 2:
- Transitions:
- 'when PyDict_New() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
- 'when PyDict_SetItem() succeeds'
- 'taking False path'
'when taking False path'
'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)))
@@ -123,50 +81,7 @@ Trace 2:
Exception:
(struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:28
-Trace 3:
- Transitions:
- 'when PyDict_New() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
- 'when PyDict_SetItem() succeeds'
- 'taking False path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)))
- str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type')))
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38
- r->ob_refcnt: None
- r->ob_type: None
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:28
-
-Trace 4:
+Trace 2:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -214,7 +129,7 @@ Trace 4:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 5:
+Trace 3:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -263,7 +178,7 @@ Trace 5:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 6:
+Trace 4:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -312,7 +227,7 @@ Trace 6:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 7:
+Trace 5:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -362,7 +277,7 @@ Trace 7:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 8:
+Trace 6:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -411,7 +326,7 @@ Trace 8:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 9:
+Trace 7:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -461,7 +376,7 @@ Trace 9:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 10:
+Trace 8:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -511,7 +426,7 @@ Trace 10:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 11:
+Trace 9:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -562,7 +477,7 @@ Trace 11:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48
-Trace 12:
+Trace 10:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -602,7 +517,7 @@ Trace 12:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43
-Trace 13:
+Trace 11:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -643,7 +558,7 @@ Trace 13:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43
-Trace 14:
+Trace 12:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -684,7 +599,7 @@ Trace 14:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43
-Trace 15:
+Trace 13:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -726,7 +641,7 @@ Trace 15:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43
-Trace 16:
+Trace 14:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -758,7 +673,7 @@ Trace 16:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38
-Trace 17:
+Trace 15:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -791,7 +706,7 @@ Trace 17:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38
-Trace 18:
+Trace 16:
Transitions:
'when PyDict_New() fails'
'taking True path'
diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stdout.txt b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stdout.txt
index ee046ce..42b2ff1 100644
--- a/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stdout.txt
+++ b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stdout.txt
@@ -7,7 +7,7 @@ Trace 0:
'when PyDict_SetItem() succeeds'
'taking False path'
'when taking True path'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)))
@@ -45,49 +45,9 @@ Trace 1:
'when PyLong_FromLong() succeeds'
'when PyDict_SetItem() succeeds'
'taking False path'
- 'when taking True path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)))
- str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type')))
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38
- r->ob_refcnt: refs: 0 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type')))
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28
-
-Trace 2:
- Transitions:
- 'when PyDict_New() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'when PyLong_FromLong() succeeds'
- 'when PyDict_SetItem() succeeds'
- 'taking False path'
'when taking False path'
'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)))
@@ -117,48 +77,7 @@ Trace 2:
Exception:
(struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28
-Trace 3:
- Transitions:
- 'when PyDict_New() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'when PyLong_FromLong() succeeds'
- 'when PyDict_SetItem() succeeds'
- 'taking False path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)))
- str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type')))
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38
- r->ob_refcnt: None
- r->ob_type: None
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28
-
-Trace 4:
+Trace 2:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -204,7 +123,7 @@ Trace 4:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 5:
+Trace 3:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -251,7 +170,7 @@ Trace 5:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 6:
+Trace 4:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -298,7 +217,7 @@ Trace 6:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 7:
+Trace 5:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -346,7 +265,7 @@ Trace 7:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 8:
+Trace 6:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -393,7 +312,7 @@ Trace 8:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 9:
+Trace 7:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -441,7 +360,7 @@ Trace 9:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 10:
+Trace 8:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -489,7 +408,7 @@ Trace 10:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 11:
+Trace 9:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -538,7 +457,7 @@ Trace 11:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45
-Trace 12:
+Trace 10:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -569,7 +488,7 @@ Trace 12:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39
-Trace 13:
+Trace 11:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -600,7 +519,7 @@ Trace 13:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38
-Trace 14:
+Trace 12:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -626,7 +545,7 @@ Trace 14:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39
-Trace 15:
+Trace 13:
Transitions:
'when PyDict_New() fails'
'taking True path'
diff --git a/tests/cpychecker/refcounts/PyDict_SetItemString/correct/stdout.txt b/tests/cpychecker/refcounts/PyDict_SetItemString/correct/stdout.txt
index 48f23db..53061f4 100644
--- a/tests/cpychecker/refcounts/PyDict_SetItemString/correct/stdout.txt
+++ b/tests/cpychecker/refcounts/PyDict_SetItemString/correct/stdout.txt
@@ -6,7 +6,7 @@ Trace 0:
'taking False path'
'when PyDict_SetItemString() succeeds'
'taking False path'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)))
@@ -37,40 +37,6 @@ Trace 1:
'taking False path'
'when PyLong_FromLong() succeeds'
'taking False path'
- 'when PyDict_SetItemString() succeeds'
- 'taking False path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)))
- str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type')))
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:28
-
-Trace 2:
- Transitions:
- 'when PyDict_New() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
'when PyDict_SetItemString() fails'
'taking True path'
'taking False path'
@@ -104,7 +70,7 @@ Trace 2:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42
-Trace 3:
+Trace 2:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -144,7 +110,7 @@ Trace 3:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42
-Trace 4:
+Trace 3:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -184,7 +150,7 @@ Trace 4:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42
-Trace 5:
+Trace 4:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -225,7 +191,7 @@ Trace 5:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42
-Trace 6:
+Trace 5:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -256,7 +222,7 @@ Trace 6:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37
-Trace 7:
+Trace 6:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -288,7 +254,7 @@ Trace 7:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37
-Trace 8:
+Trace 7:
Transitions:
'when PyDict_New() fails'
'taking True path'
diff --git a/tests/cpychecker/refcounts/PySys_SetObject/correct/stdout.txt b/tests/cpychecker/refcounts/PySys_SetObject/correct/stdout.txt
index f883342..6bf678a 100644
--- a/tests/cpychecker/refcounts/PySys_SetObject/correct/stdout.txt
+++ b/tests/cpychecker/refcounts/PySys_SetObject/correct/stdout.txt
@@ -3,7 +3,7 @@ Trace 0:
'when PyString_FromString() succeeds'
'taking False path'
'when PySys_SetObject() succeeds'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=40), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')))
@@ -32,37 +32,6 @@ Trace 1:
Transitions:
'when PyString_FromString() succeeds'
'taking False path'
- 'when PySys_SetObject() succeeds'
- 'when taking False path'
- 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=40), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')))
- str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:40
- r->ob_refcnt: refs: 1 + N where N >= 1
- r->ob_type: None
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31:
- repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=31))
- str(): PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:29
-
-Trace 2:
- Transitions:
- 'when PyString_FromString() succeeds'
- 'taking False path'
'when PySys_SetObject() fails'
'when taking True path'
'returning'
@@ -89,7 +58,7 @@ Trace 2:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:37
-Trace 3:
+Trace 2:
Transitions:
'when PyString_FromString() succeeds'
'taking False path'
@@ -120,7 +89,7 @@ Trace 3:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:37
-Trace 4:
+Trace 3:
Transitions:
'when PyString_FromString() fails'
'taking True path'
diff --git a/tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/stdout.txt b/tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/stdout.txt
index ec41f9d..8105fef 100644
--- a/tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/stdout.txt
+++ b/tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/stdout.txt
@@ -3,7 +3,7 @@ Trace 0:
'when PyLong_FromLong() succeeds'
'when Py_BuildValue() succeeds'
'taking False path'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), region=RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37)))
@@ -31,37 +31,6 @@ Trace 0:
Trace 1:
Transitions:
'when PyLong_FromLong() succeeds'
- 'when Py_BuildValue() succeeds'
- 'taking False path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), region=RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37)))
- str(): (struct PyObject *)&RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37)) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), region=Region('PyTypeObject for new ref from call to Py_BuildValue'))
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=34))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:29
-
-Trace 2:
- Transitions:
- 'when PyLong_FromLong() succeeds'
'when Py_BuildValue() fails'
'taking False path'
'when taking True path'
@@ -87,7 +56,7 @@ Trace 2:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37
-Trace 3:
+Trace 2:
Transitions:
'when PyLong_FromLong() succeeds'
'when Py_BuildValue() fails'
@@ -116,7 +85,7 @@ Trace 3:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37
-Trace 4:
+Trace 3:
Transitions:
'when PyLong_FromLong() fails'
'when Py_BuildValue() fails'
diff --git a/tests/cpychecker/refcounts/loop_n_times/stdout.txt b/tests/cpychecker/refcounts/loop_n_times/stdout.txt
index 27e8165..6ae249f 100644
--- a/tests/cpychecker/refcounts/loop_n_times/stdout.txt
+++ b/tests/cpychecker/refcounts/loop_n_times/stdout.txt
@@ -82,7 +82,7 @@ Trace 2:
'PyList_SetItem() succeeds'
'when considering value == (int)1 from tests/cpychecker/refcounts/loop_n_times/input.c:34'
'taking False path'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)))
@@ -113,45 +113,6 @@ Trace 3:
'taking False path'
'when PyList_New() succeeds'
'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
- 'when considering range: 1 <= value <= 0x7fffffff'
- 'taking True path'
- 'PyList_SetItem() succeeds'
- 'when considering value == (int)1 from tests/cpychecker/refcounts/loop_n_times/input.c:34'
- 'taking False path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)))
- str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)) from tests/cpychecker/refcounts/loop_n_times/input.c:38
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyList_Type')))
- Region("region-for-arg-gcc.ParmDecl('self')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('self')")
- str(): Region("region-for-arg-gcc.ParmDecl('self')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
- Region("region-for-arg-gcc.ParmDecl('args')"):
- repr(): Region("region-for-arg-gcc.ParmDecl('args')")
- str(): Region("region-for-arg-gcc.ParmDecl('args')")
- r->ob_refcnt: refs: 0 + N where N >= 1
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
- PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=42))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:29
-
-Trace 4:
- Transitions:
- 'when PyArg_ParseTuple() succeeds'
- 'taking False path'
- 'when PyList_New() succeeds'
- 'taking False path'
'when PyLong_FromLong() fails'
'taking True path'
'when taking True path'
@@ -177,7 +138,7 @@ Trace 4:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loop_n_times/input.c:42
-Trace 5:
+Trace 4:
Transitions:
'when PyArg_ParseTuple() succeeds'
'taking False path'
@@ -209,7 +170,7 @@ Trace 5:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loop_n_times/input.c:42
-Trace 6:
+Trace 5:
Transitions:
'when PyArg_ParseTuple() succeeds'
'taking False path'
@@ -232,7 +193,7 @@ Trace 6:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loop_n_times/input.c:38
-Trace 7:
+Trace 6:
Transitions:
'when PyArg_ParseTuple() fails'
'taking True path'
diff --git a/tests/cpychecker/refcounts/object_from_callback/stdout.txt b/tests/cpychecker/refcounts/object_from_callback/stdout.txt
index 3c7ec6a..3a2fa75 100644
--- a/tests/cpychecker/refcounts/object_from_callback/stdout.txt
+++ b/tests/cpychecker/refcounts/object_from_callback/stdout.txt
@@ -9,7 +9,7 @@ Trace 0:
'when PyDict_SetItem() succeeds'
'taking False path'
'when taking True path'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)))
@@ -39,41 +39,9 @@ Trace 1:
'taking False path'
'when PyDict_SetItem() succeeds'
'taking False path'
- 'when taking True path'
- 'when taking False path'
- 'calling tp_dealloc on new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)))
- str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) from tests/cpychecker/refcounts/object_from_callback/input.c:34
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type')))
- PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39
- r->ob_refcnt: refs: 0 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type')))
- new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48:
- repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48))
- str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:29
-
-Trace 2:
- Transitions:
- 'when PyDict_New() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
- 'when call succeeds'
- 'taking False path'
- 'when PyDict_SetItem() succeeds'
- 'taking False path'
'when taking False path'
'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39'
- 'when taking True path'
+ 'taking True path'
'returning'
Return value:
repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)))
@@ -93,40 +61,7 @@ Trace 2:
Exception:
(struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:29
-Trace 3:
- Transitions:
- 'when PyDict_New() succeeds'
- 'taking False path'
- 'when PyLong_FromLong() succeeds'
- 'taking False path'
- 'when call succeeds'
- 'taking False path'
- 'when PyDict_SetItem() succeeds'
- 'taking False path'
- 'when taking False path'
- 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39'
- 'when taking False path'
- 'calling tp_dealloc on new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48'
- 'returning'
- Return value:
- repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)))
- str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) from tests/cpychecker/refcounts/object_from_callback/input.c:34
- r->ob_refcnt: refs: 1 + N where N >= 0
- r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type')))
- PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39:
- repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39))
- str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39
- r->ob_refcnt: None
- r->ob_type: None
- new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48:
- repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48))
- str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48
- r->ob_refcnt: None
- r->ob_type: None
- Exception:
- (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:29
-
-Trace 4:
+Trace 2:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -164,7 +99,7 @@ Trace 4:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 5:
+Trace 3:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -203,7 +138,7 @@ Trace 5:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 6:
+Trace 4:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -242,7 +177,7 @@ Trace 6:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 7:
+Trace 5:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -282,7 +217,7 @@ Trace 7:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 8:
+Trace 6:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -321,7 +256,7 @@ Trace 8:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 9:
+Trace 7:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -361,7 +296,7 @@ Trace 9:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 10:
+Trace 8:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -401,7 +336,7 @@ Trace 10:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 11:
+Trace 9:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -442,7 +377,7 @@ Trace 11:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54
-Trace 12:
+Trace 10:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -472,7 +407,7 @@ Trace 12:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48
-Trace 13:
+Trace 11:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -503,7 +438,7 @@ Trace 13:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48
-Trace 14:
+Trace 12:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -534,7 +469,7 @@ Trace 14:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48
-Trace 15:
+Trace 13:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -566,7 +501,7 @@ Trace 15:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48
-Trace 16:
+Trace 14:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -588,7 +523,7 @@ Trace 16:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:39
-Trace 17:
+Trace 15:
Transitions:
'when PyDict_New() succeeds'
'taking False path'
@@ -611,7 +546,7 @@ Trace 17:
Exception:
(struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:39
-Trace 18:
+Trace 16:
Transitions:
'when PyDict_New() fails'
'taking True path'