@@ -50,12 +50,12 @@ predicate strictlyDominates(IRBlock b1, int i1, IRBlock b2, int i2) {
50
50
module FlowFromFree< isSinkSig / 2 isASink, isExcludedSig / 2 isExcluded> {
51
51
module FlowFromFreeConfig implements DataFlow:: StateConfigSig {
52
52
class FlowState instanceof Expr {
53
- FlowState ( ) { isFree ( _, this , _) }
53
+ FlowState ( ) { isFree ( _, _ , this , _) }
54
54
55
55
string toString ( ) { result = super .toString ( ) }
56
56
}
57
57
58
- predicate isSource ( DataFlow:: Node node , FlowState state ) { isFree ( node , state , _) }
58
+ predicate isSource ( DataFlow:: Node node , FlowState state ) { isFree ( node , _ , state , _) }
59
59
60
60
pragma [ inline]
61
61
predicate isSink ( DataFlow:: Node sink , FlowState state ) {
@@ -64,7 +64,7 @@ module FlowFromFree<isSinkSig/2 isASink, isExcludedSig/2 isExcluded> {
64
64
DeallocationExpr dealloc
65
65
|
66
66
isASink ( sink , e ) and
67
- isFree ( source , state , dealloc ) and
67
+ isFree ( source , _ , state , dealloc ) and
68
68
e != state and
69
69
source .hasIndexInBlock ( b1 , i1 ) and
70
70
sink .hasIndexInBlock ( b2 , i2 ) and
@@ -98,11 +98,12 @@ module FlowFromFree<isSinkSig/2 isASink, isExcludedSig/2 isExcluded> {
98
98
* `dealloc` after the call returns (i.e., the post-update node associated with
99
99
* the argument to `dealloc`).
100
100
*/
101
- predicate isFree ( DataFlow:: Node n , Expr e , DeallocationExpr dealloc ) {
101
+ predicate isFree ( DataFlow:: Node outgoing , DataFlow :: Node incoming , Expr e , DeallocationExpr dealloc ) {
102
102
exists ( Expr conv |
103
103
e = conv .getUnconverted ( ) and
104
104
conv = dealloc .getFreedExpr ( ) .getFullyConverted ( ) and
105
- conv = n .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asConvertedExpr ( )
105
+ incoming = outgoing .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) and
106
+ conv = incoming .asConvertedExpr ( )
106
107
) and
107
108
// Ignore realloc functions
108
109
not exists ( dealloc .( FunctionCall ) .getTarget ( ) .( AllocationFunction ) .getReallocPtrArg ( ) )
0 commit comments