C#: Add support for synthetic fields in MaD for C#.

This commit is contained in:
Michael Nebel
2024-09-02 11:07:11 +02:00
parent 0d343c5ce1
commit 6e81d74558
2 changed files with 12 additions and 0 deletions

View File

@@ -3075,6 +3075,7 @@ ContentApprox getContentApprox(Content c) {
* ensuring that they are visible to the taint tracking / data flow library.
*/
private module SyntheticFields {
private import semmle.code.csharp.dataflow.internal.ExternalFlow
private import semmle.code.csharp.frameworks.system.threading.Tasks
private import semmle.code.csharp.frameworks.system.runtime.CompilerServices
}

View File

@@ -431,6 +431,17 @@ Declaration interpretElement(
)
}
private predicate parseSynthField(AccessPathToken c, string name) {
c.getName() = "SyntheticField" and name = c.getAnArgument()
}
/**
* An adapter class for adding synthetic fields from MaD.
*/
private class SyntheticFieldAdapter extends SyntheticField {
SyntheticFieldAdapter() { parseSynthField(_, this) }
}
cached
private module Cached {
/**