@@ -22,15 +22,28 @@ import codingstandards.c.cert
2222import codingstandards.cpp.ConcurrencyNew
2323import semmle.code.cpp.dataflow.new.DataFlow
2424
25+ newtype Direction =
26+ Incoming ( ) or
27+ Outgoing ( )
28+
29+ predicate isSource ( DataFlow:: Node node , Direction d ) {
30+ exists ( TSSCreateFunctionCall tsc , Expr e |
31+ // the only requirement of the source is that at some point
32+ // it refers to the key of a create statement
33+ e .getParent * ( ) = tsc .getKey ( )
34+ |
35+ d = Outgoing ( ) and
36+ e = [ node .asExpr ( ) , node .asDefiningArgument ( ) ]
37+ or
38+ d = Incoming ( ) and
39+ e = [ node .asExpr ( ) , node .asIndirectArgument ( ) ]
40+ )
41+ }
42+
2543module TssCreateToTssDeleteConfig implements DataFlow:: ConfigSig {
26- predicate isSource ( DataFlow:: Node node ) {
27- exists ( TSSCreateFunctionCall tsc , Expr e |
28- // the only requirement of the source is that at some point
29- // it refers to the key of a create statement
30- e .getParent * ( ) = tsc .getKey ( ) and
31- ( e = node .asDefiningArgument ( ) or e = node .asExpr ( ) )
32- )
33- }
44+ predicate isSource ( DataFlow:: Node node ) { isSource ( node , Outgoing ( ) ) }
45+
46+ predicate isBarrierIn ( DataFlow:: Node node ) { isSource ( node , Incoming ( ) ) }
3447
3548 predicate isSink ( DataFlow:: Node node ) {
3649 exists ( TSSDeleteFunctionCall tsd , Expr e |
0 commit comments