mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Add external flow tests for synthetic fields.
This commit is contained in:
@@ -291,4 +291,42 @@ namespace My.Qltest
|
|||||||
|
|
||||||
static void Sink(object o) { }
|
static void Sink(object o) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test synthetic fields
|
||||||
|
public class K {
|
||||||
|
|
||||||
|
public object MyField;
|
||||||
|
|
||||||
|
public void SetMySyntheticField(object o) => throw null;
|
||||||
|
|
||||||
|
public object GetMySyntheticField() => throw null;
|
||||||
|
|
||||||
|
public void SetMyNestedSyntheticField(object o) => throw null;
|
||||||
|
|
||||||
|
public object GetMyNestedSyntheticField() => throw null;
|
||||||
|
|
||||||
|
public void SetMyFieldOnSyntheticField(object o) => throw null;
|
||||||
|
|
||||||
|
public object GetMyFieldOnSyntheticField() => throw null;
|
||||||
|
|
||||||
|
public void M1() {
|
||||||
|
var o = new object();
|
||||||
|
SetMySyntheticField(o);
|
||||||
|
Sink(GetMySyntheticField());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void M2() {
|
||||||
|
var o = new object();
|
||||||
|
SetMyNestedSyntheticField(o);
|
||||||
|
Sink(GetMyNestedSyntheticField());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void M3() {
|
||||||
|
var o = new object();
|
||||||
|
SetMyFieldOnSyntheticField(o);
|
||||||
|
Sink(GetMyFieldOnSyntheticField());
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Sink(object o) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,6 +243,14 @@ nodes
|
|||||||
subpaths
|
subpaths
|
||||||
| ExternalFlow.cs:84:29:84:32 | access to local variable objs : null [element] : Object | ExternalFlow.cs:84:35:84:35 | o : Object | ExternalFlow.cs:84:40:84:40 | access to parameter o : Object | ExternalFlow.cs:84:25:84:41 | call to method Map<Object,Object> : T[] [element] : Object |
|
| ExternalFlow.cs:84:29:84:32 | access to local variable objs : null [element] : Object | ExternalFlow.cs:84:35:84:35 | o : Object | ExternalFlow.cs:84:40:84:40 | access to parameter o : Object | ExternalFlow.cs:84:25:84:41 | call to method Map<Object,Object> : T[] [element] : Object |
|
||||||
invalidModelRow
|
invalidModelRow
|
||||||
|
| Unrecognized input specification "SyntheticField[My.Qltest.K.MySyntheticField1]" in summary model. |
|
||||||
|
| Unrecognized input specification "SyntheticField[My.Qltest.K.MySyntheticField2]" in summary model. |
|
||||||
|
| Unrecognized input specification "SyntheticField[My.Qltest.K.MySyntheticField]" in summary model. |
|
||||||
|
| Unrecognized input specification "SyntheticField[MySyntheticField1.MyNestedSyntheticField]" in summary model. |
|
||||||
|
| Unrecognized output specification "SyntheticField[My.Qltest.K.MySyntheticField1]" in summary model. |
|
||||||
|
| Unrecognized output specification "SyntheticField[My.Qltest.K.MySyntheticField2]" in summary model. |
|
||||||
|
| Unrecognized output specification "SyntheticField[My.Qltest.K.MySyntheticField]" in summary model. |
|
||||||
|
| Unrecognized output specification "SyntheticField[MySyntheticField1.MyNestedSyntheticField]" in summary model. |
|
||||||
#select
|
#select
|
||||||
| ExternalFlow.cs:10:18:10:33 | call to method StepArgRes | ExternalFlow.cs:9:27:9:38 | object creation of type Object : Object | ExternalFlow.cs:10:18:10:33 | call to method StepArgRes | $@ | ExternalFlow.cs:9:27:9:38 | object creation of type Object : Object | object creation of type Object : Object |
|
| ExternalFlow.cs:10:18:10:33 | call to method StepArgRes | ExternalFlow.cs:9:27:9:38 | object creation of type Object : Object | ExternalFlow.cs:10:18:10:33 | call to method StepArgRes | $@ | ExternalFlow.cs:9:27:9:38 | object creation of type Object : Object | object creation of type Object : Object |
|
||||||
| ExternalFlow.cs:18:18:18:24 | access to local variable argOut1 | ExternalFlow.cs:15:29:15:40 | object creation of type Object : Object | ExternalFlow.cs:18:18:18:24 | access to local variable argOut1 | $@ | ExternalFlow.cs:15:29:15:40 | object creation of type Object : Object | object creation of type Object : Object |
|
| ExternalFlow.cs:18:18:18:24 | access to local variable argOut1 | ExternalFlow.cs:15:29:15:40 | object creation of type Object : Object | ExternalFlow.cs:18:18:18:24 | access to local variable argOut1 | $@ | ExternalFlow.cs:15:29:15:40 | object creation of type Object : Object | object creation of type Object : Object |
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ extensions:
|
|||||||
- ["My.Qltest", "J", false, "SetProp1", "(System.Object)", "", "Argument[0]", "Argument[this]", "value", "manual"]
|
- ["My.Qltest", "J", false, "SetProp1", "(System.Object)", "", "Argument[0]", "Argument[this]", "value", "manual"]
|
||||||
- ["My.Qltest", "J", false, "get_Prop2", "()", "", "Argument[this]", "ReturnValue", "value", "df-generated"]
|
- ["My.Qltest", "J", false, "get_Prop2", "()", "", "Argument[this]", "ReturnValue", "value", "df-generated"]
|
||||||
- ["My.Qltest", "J", false, "SetProp2", "(System.Object)", "", "Argument[0]", "Argument[this]", "value", "manual"]
|
- ["My.Qltest", "J", false, "SetProp2", "(System.Object)", "", "Argument[0]", "Argument[this]", "value", "manual"]
|
||||||
|
- ["My.Qltest", "K", false, "SetMySyntheticField", "(System.Object)", "", "Argument[0]", "Argument[this].SyntheticField[My.Qltest.K.MySyntheticField]", "value", "manual"]
|
||||||
|
- ["My.Qltest", "K", false, "GetMySyntheticField", "()", "", "Argument[this].SyntheticField[My.Qltest.K.MySyntheticField]", "ReturnValue", "value", "manual"]
|
||||||
|
- ["My.Qltest", "K", false, "SetMyNestedSyntheticField", "(System.Object)", "", "Argument[0]", "Argument[this].SyntheticField[My.Qltest.K.MySyntheticField1].SyntheticField[MySyntheticField1.MyNestedSyntheticField]", "value", "manual"]
|
||||||
|
- ["My.Qltest", "K", false, "GetMyNestedSyntheticField", "()", "", "Argument[this].SyntheticField[My.Qltest.K.MySyntheticField1].SyntheticField[MySyntheticField1.MyNestedSyntheticField]", "ReturnValue", "value", "manual"]
|
||||||
|
- ["My.Qltest", "K", false, "SetMyFieldOnSyntheticField", "(System.Object)", "", "Argument[0]", "Argument[this].SyntheticField[My.Qltest.K.MySyntheticField2].Field[My.Qltest.K.MyField]", "value", "manual"]
|
||||||
|
- ["My.Qltest", "K", false, "GetMyFieldOnSyntheticField", "()", "", "Argument[this].SyntheticField[My.Qltest.K.MySyntheticField2].Field[My.Qltest.K.MyField]", "ReturnValue", "value", "manual"]
|
||||||
|
|
||||||
- addsTo:
|
- addsTo:
|
||||||
pack: codeql/csharp-all
|
pack: codeql/csharp-all
|
||||||
extensible: neutralModel
|
extensible: neutralModel
|
||||||
|
|||||||
Reference in New Issue
Block a user