Skip to content

Commit 5fe0d0e

Browse files
committed
C#: Add discarding for diagnostics and extractor messages.
1 parent b91f61f commit 5fe0d0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

csharp/ql/lib/semmle/code/csharp/Overlay.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ abstract private class DiscardableEntity extends @locatable {
3333
* The rest use named TRAP IDs.
3434
*/
3535
overlay[local]
36-
private class StarEntity = @expr or @stmt;
36+
private class StarEntity = @expr or @stmt or @diagnostic or @extractor_message;
3737

3838
overlay[discard_entity]
3939
private predicate discardStarEntity(@locatable e) {
@@ -98,7 +98,9 @@ private class PossibleDiscardableEntity extends DiscardableEntity instanceof @lo
9898
param_location(this, loc) or
9999
type_mention_location(this, loc) or
100100
commentline_location(this, loc) or
101-
commentblock_location(this, loc)
101+
commentblock_location(this, loc) or
102+
diagnostics(this, _, _, _, _, loc) or
103+
extractor_messages(this, _, _, _, _, loc, _)
102104
)
103105
}
104106
}

0 commit comments

Comments
 (0)