From 022cbfa009da67c63c35dd922f34fb5da7cf2922 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 29 Aug 2022 16:02:57 +0200 Subject: [PATCH] C#: Support 'WithElement'. --- .../code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll index 53805bcecff..864fda40cf7 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll @@ -165,6 +165,8 @@ SummaryComponent interpretComponentSpecific(AccessPathToken c) { or c = "WithoutElement" and result = SummaryComponent::withoutContent(any(ElementContent ec)) or + c = "WithElement" and result = SummaryComponent::withContent(any(ElementContent ec)) + or // Qualified names may contain commas,such as in `Tuple<,>`, so get the entire argument list // rather than an individual argument. exists(Field f | @@ -203,6 +205,8 @@ string getComponentSpecificCsv(SummaryComponent sc) { or exists(Content c | sc = TWithoutContentSummaryComponent(c) and result = "WithoutElement") or + exists(Content c | sc = TWithContentSummaryComponent(c) and result = "WithElement") + or exists(ReturnKind rk | sc = TReturnSummaryComponent(rk) and result = "ReturnValue[" + rk + "]" and