@@ -50,12 +50,12 @@ predicate strictlyDominates(IRBlock b1, int i1, IRBlock b2, int i2) {
5050module FlowFromFree< isSinkSig / 2 isASink, isExcludedSig / 2 isExcluded> {
5151 module FlowFromFreeConfig implements DataFlow:: StateConfigSig {
5252 class FlowState instanceof Expr {
53- FlowState ( ) { isFree ( _, this , _) }
53+ FlowState ( ) { isFree ( _, _ , this , _) }
5454
5555 string toString ( ) { result = super .toString ( ) }
5656 }
5757
58- predicate isSource ( DataFlow:: Node node , FlowState state ) { isFree ( node , state , _) }
58+ predicate isSource ( DataFlow:: Node node , FlowState state ) { isFree ( node , _ , state , _) }
5959
6060 pragma [ inline]
6161 predicate isSink ( DataFlow:: Node sink , FlowState state ) {
@@ -64,7 +64,7 @@ module FlowFromFree<isSinkSig/2 isASink, isExcludedSig/2 isExcluded> {
6464 DeallocationExpr dealloc
6565 |
6666 isASink ( sink , e ) and
67- isFree ( source , state , dealloc ) and
67+ isFree ( source , _ , state , dealloc ) and
6868 e != state and
6969 source .hasIndexInBlock ( b1 , i1 ) and
7070 sink .hasIndexInBlock ( b2 , i2 ) and
@@ -98,11 +98,12 @@ module FlowFromFree<isSinkSig/2 isASink, isExcludedSig/2 isExcluded> {
9898 * `dealloc` after the call returns (i.e., the post-update node associated with
9999 * the argument to `dealloc`).
100100 */
101- predicate isFree ( DataFlow:: Node n , Expr e , DeallocationExpr dealloc ) {
101+ predicate isFree ( DataFlow:: Node outgoing , DataFlow :: Node incoming , Expr e , DeallocationExpr dealloc ) {
102102 exists ( Expr conv |
103103 e = conv .getUnconverted ( ) and
104104 conv = dealloc .getFreedExpr ( ) .getFullyConverted ( ) and
105- conv = n .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asConvertedExpr ( )
105+ incoming = outgoing .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) and
106+ conv = incoming .asConvertedExpr ( )
106107 ) and
107108 // Ignore realloc functions
108109 not exists ( dealloc .( FunctionCall ) .getTarget ( ) .( AllocationFunction ) .getReallocPtrArg ( ) )
0 commit comments