GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Expand range of callables requiring nodes to include unbound declarat… · github/codeql@3e91f0f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • csharp/ql/lib/semmle/code/csharp/dataflow/internal
    • DataFlowPrivate.qll
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll
+22-8Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -998,20 +998,34 @@ private class InstanceCallable extends Callable {
998998
/**
999999
* A callable which is either itself defined in source or which is the target
10001000
* of some call in source, and therefore ought to have dataflow nodes created.
1001+
*
1002+
* Note that for library methods these are always unbound declarations, since
1003+
* generic instantiations never have dataflow nodes constructed.
10011004
*/
10021005
private class CallableUsedInSource extends Callable {
10031006
CallableUsedInSource() {
1007+
// Should generate nodes even for abstract methods declared in source
10041008
this.fromSource()
10051009
or
1006-
// Note that getARuntimeTarget cannot be used here, because the
1007-
// DelegateLikeCall case depends on lambda-flow, which in turn
1008-
// uses the dataflow library; hence this would introduce recursion
1009-
// into the definition of data-flow nodes.
1010-
exists(Call c, DispatchCall dc | c.fromSource() and c = dc.getCall() |
1011-
this = dc.getADynamicTarget()
1012-
)
1010+
// Should generate nodes even for synthetic methods derived from source
1011+
this.hasBody()
10131012
or
1014-
this = any(CallableAccess ca | ca.fromSource()).getTarget()
1013+
exists(Callable target |
1014+
exists(Call c | c.fromSource() |
1015+
// Note that getADynamicTarget does not always include getTarget.
1016+
target = c.getTarget()
1017+
or
1018+
// Note that getARuntimeTarget cannot be used here, because the
1019+
// DelegateLikeCall case depends on lambda-flow, which in turn
1020+
// uses the dataflow library; hence this would introduce recursion
1021+
// into the definition of data-flow nodes.
1022+
exists(DispatchCall dc | c = dc.getCall() | target = dc.getADynamicTarget())
1023+
)
1024+
or
1025+
target = any(CallableAccess ca | ca.fromSource()).getTarget()
1026+
|
1027+
this = target.getUnboundDeclaration()
1028+
)
10151029
}
10161030
}
10171031

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.