C#: Remove un-needed code as we extract synthetic default constructors.

This commit is contained in:
Michael Nebel
2024-02-22 11:15:00 +01:00
parent 14de39a854
commit cf9c3d5dd1

View File

@@ -20,13 +20,7 @@ private import semmle.code.csharp.frameworks.system.collections.Generic
*/
DotNet::Callable getCallableForDataFlow(DotNet::Callable c) {
exists(DotNet::Callable unboundDecl | unboundDecl = c.getUnboundDeclaration() |
(
result.hasBody()
or
// take synthesized bodies into account, e.g. implicit constructors
// with field initializer assignments
result = any(ControlFlow::Nodes::ElementNode n).getEnclosingCallable()
) and
result.hasBody() and
if unboundDecl.getFile().fromSource()
then
// C# callable with C# implementation in the database