File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
csharp/ql/src/Language Abuse Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1515import csharp
1616import semmle.code.csharp.commons.StructuralComparison
1717
18+ pragma [ nomagic]
19+ private predicate relevant ( Expr left , Expr right ) {
20+ exists ( NullCoalescingOperation nce |
21+ left = nce .getLeftOperand ( ) and
22+ right = nce .getRightOperand ( )
23+ )
24+ }
25+
1826pragma [ noinline]
1927private predicate same ( AssignableAccess x , AssignableAccess y ) {
20- exists ( NullCoalescingOperation nc |
21- x = nc . getLeftOperand ( ) and
22- y = nc . getRightOperand ( ) . getAChildExpr * ( )
23- ) and
24- sameGvn ( x , y )
28+ exists ( Expr e |
29+ relevant ( x , e ) and
30+ y = e . getAChildExpr * ( ) and
31+ sameGvn ( x , y )
32+ )
2533}
2634
2735private predicate uselessNullCoalescingOperation ( NullCoalescingOperation nce ) {
You can’t perform that action at this time.
0 commit comments