File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
csharp/ql/lib/semmle/code/csharp Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -861,6 +861,12 @@ class YieldReturnStmt extends YieldStmt {
861
861
override string getAPrimaryQlClass ( ) { result = "YieldReturnStmt" }
862
862
}
863
863
864
+ bindingset [ cfe1, cfe2]
865
+ pragma [ inline_late]
866
+ private predicate sameCallable ( ControlFlowElement cfe1 , ControlFlowElement cfe2 ) {
867
+ cfe1 .getEnclosingCallable ( ) = cfe2 .getEnclosingCallable ( )
868
+ }
869
+
864
870
/**
865
871
* A `try` statement, for example
866
872
*
@@ -947,8 +953,7 @@ class TryStmt extends Stmt, @try_stmt {
947
953
mid = this .getATriedElement ( ) and
948
954
not mid instanceof TryStmt and
949
955
result = mid .getAChild ( ) and
950
- pragma [ only_bind_into ] ( mid .getEnclosingCallable ( ) ) =
951
- pragma [ only_bind_into ] ( result .getEnclosingCallable ( ) )
956
+ sameCallable ( mid , result )
952
957
)
953
958
}
954
959
}
You can’t perform that action at this time.
0 commit comments