Skip to content

Commit 96a9871

Browse files
committed
C++: Add 'DataFlow::indirectExpr' predicates since Coding Standards now depend on such a predicate.
1 parent a7eb87a commit 96a9871

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,24 @@ module Public {
946946
*/
947947
ExprNode exprNode(Expr e) { result.getExpr(_) = e }
948948

949+
/**
950+
* Gets the `Node` corresponding to the value after `indirection` number of
951+
* dereferences of `e` or any of its conversions. There is no result if `e`
952+
* is a `Conversion`. For data flowing _out of_ an expression, like when an
953+
* argument is passed by reference, use
954+
* `definitionByReferenceNodeFromArgument` instead.
955+
*/
956+
IndirectExprNode indirectExprNode(Expr e, int indirection) { result.getExpr(indirection) = e }
957+
958+
/**
959+
* Gets the `Node` corresponding to the value after any number of
960+
* dereferences of `e` or any of its conversions. There is no result if `e`
961+
* is a `Conversion`. For data flowing _out of_ an expression, like when an
962+
* argument is passed by reference, use
963+
* `definitionByReferenceNodeFromArgument` instead.
964+
*/
965+
IndirectExprNode indirectExprNode(Expr e) { result = indirectExprNode(e, _) }
966+
949967
/**
950968
* Gets the `Node` corresponding to the value of evaluating `e`. Here, `e` may
951969
* be a `Conversion`. For data flowing _out of_ an expression, like when an

0 commit comments

Comments
 (0)