Skip to content

Commit b204f78

Browse files
committed
C#: Remove special handling of bulk types.
1 parent b95a332 commit b204f78

File tree

3 files changed

+1
-30
lines changed

3 files changed

+1
-30
lines changed

csharp/ql/src/utils/model-generator/ModelGeneratorUtilsSpecific.qll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,8 @@ string asPartialModel(TargetApi api) {
6666
*/
6767
predicate isRelevantType(Type t) { not t instanceof Enum }
6868

69-
private predicate isPrimitiveTypeUsedForBulkData(Type t) {
70-
t.getName().regexpMatch("byte|char|Byte|Char")
71-
}
72-
7369
private string parameterAccess(Parameter p) {
74-
if
75-
isCollectionType(p.getType()) and
76-
not isPrimitiveTypeUsedForBulkData(p.getType().(ArrayType).getElementType())
70+
if isCollectionType(p.getType())
7771
then result = "Argument[" + p.getPosition() + "].Element"
7872
else result = "Argument[" + p.getPosition() + "]"
7973
}

csharp/ql/test/utils/model-generator/CaptureSummaryModels.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
| Summaries;BasicFlow;false;ReturnSubstring;(System.String);Argument[0];ReturnValue;taint |
99
| Summaries;BasicFlow;false;ReturnThis;(System.Object);Argument[Qualifier];ReturnValue;value |
1010
| Summaries;BasicFlow;false;SetField;(System.String);Argument[0];Argument[Qualifier];taint |
11-
| Summaries;BulkArrayFlow;false;AssignFieldToBulkArray;(System.Char[]);Argument[Qualifier];Argument[0];taint |
12-
| Summaries;BulkArrayFlow;false;AssignToBulkArray;(System.Char[],System.Char);Argument[1];Argument[0];taint |
13-
| Summaries;BulkArrayFlow;false;ReturnBulkArrayElement;(System.Byte[]);Argument[0];ReturnValue;taint |
1411
| Summaries;CollectionFlow;false;AddFieldToList;(System.Collections.Generic.List<System.String>);Argument[Qualifier];Argument[0].Element;taint |
1512
| Summaries;CollectionFlow;false;AddToList;(System.Collections.Generic.List<System.Object>,System.Object);Argument[1];Argument[0].Element;taint |
1613
| Summaries;CollectionFlow;false;AssignFieldToArray;(System.Object[]);Argument[Qualifier];Argument[0].Element;taint |

csharp/ql/test/utils/model-generator/Summaries.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,26 +104,6 @@ public IEnumerable<string> ReturnFieldInIEnumerable()
104104
}
105105
}
106106

107-
public class BulkArrayFlow
108-
{
109-
private char tainted;
110-
111-
public void AssignToBulkArray(char[] input, char data)
112-
{
113-
input[0] = data;
114-
}
115-
116-
public byte ReturnBulkArrayElement(byte[] input)
117-
{
118-
return input[0];
119-
}
120-
121-
public void AssignFieldToBulkArray(char[] input)
122-
{
123-
input[0] = tainted;
124-
}
125-
}
126-
127107
public class GenericFlow<T>
128108
{
129109
private T tainted;

0 commit comments

Comments
 (0)