Skip to content

Commit 3c6f538

Browse files
committed
C#: Support Cast expressions to have post update notes.
1 parent ba47947 commit 3c6f538

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,10 @@ module LocalFlow {
416416
* will be the value of `n`.
417417
*/
418418
private ControlFlow::Nodes::ExprNode getALastEvalNode(ControlFlow::Nodes::ExprNode cfn) {
419-
any(LocalExprStepConfiguration x).hasExprPath(_, result, any(ConditionalExpr ce), cfn)
419+
exists(Expr e | any(LocalExprStepConfiguration x).hasExprPath(_, result, e, cfn) |
420+
e instanceof ConditionalExpr or
421+
e instanceof Cast
422+
)
420423
}
421424

422425
/** Gets a node for which to construct a post-update node for argument `arg`. */

0 commit comments

Comments
 (0)