Skip to content

Commit 1762a2f

Browse files
committed
C#: Do not clear content of reference type struct fields.
1 parent 93d07a5 commit 1762a2f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-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
@@ -2528,6 +2528,7 @@ private predicate clearsCont(Node n, Content c) {
25282528
a.getType() = s and
25292529
f = s.getAField() and
25302530
c.(FieldContent).getField() = f.getUnboundDeclaration() and
2531+
not f.getType().isRefType() and
25312532
not f.isRef()
25322533
)
25332534
or

0 commit comments

Comments
 (0)