Skip to content

Commit 6e81d74

Browse files
committed
C#: Add support for synthetic fields in MaD for C#.
1 parent 0d343c5 commit 6e81d74

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3075,6 +3075,7 @@ ContentApprox getContentApprox(Content c) {
30753075
* ensuring that they are visible to the taint tracking / data flow library.
30763076
*/
30773077
private module SyntheticFields {
3078+
private import semmle.code.csharp.dataflow.internal.ExternalFlow
30783079
private import semmle.code.csharp.frameworks.system.threading.Tasks
30793080
private import semmle.code.csharp.frameworks.system.runtime.CompilerServices
30803081
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,17 @@ Declaration interpretElement(
431431
)
432432
}
433433

434+
private predicate parseSynthField(AccessPathToken c, string name) {
435+
c.getName() = "SyntheticField" and name = c.getAnArgument()
436+
}
437+
438+
/**
439+
* An adapter class for adding synthetic fields from MaD.
440+
*/
441+
private class SyntheticFieldAdapter extends SyntheticField {
442+
SyntheticFieldAdapter() { parseSynthField(_, this) }
443+
}
444+
434445
cached
435446
private module Cached {
436447
/**

0 commit comments

Comments
 (0)