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 {
861861 override string getAPrimaryQlClass ( ) { result = "YieldReturnStmt" }
862862}
863863
864+ bindingset [ cfe1, cfe2]
865+ pragma [ inline_late]
866+ private predicate sameCallable ( ControlFlowElement cfe1 , ControlFlowElement cfe2 ) {
867+ cfe1 .getEnclosingCallable ( ) = cfe2 .getEnclosingCallable ( )
868+ }
869+
864870/**
865871 * A `try` statement, for example
866872 *
@@ -947,8 +953,7 @@ class TryStmt extends Stmt, @try_stmt {
947953 mid = this .getATriedElement ( ) and
948954 not mid instanceof TryStmt and
949955 result = mid .getAChild ( ) and
950- pragma [ only_bind_into ] ( mid .getEnclosingCallable ( ) ) =
951- pragma [ only_bind_into ] ( result .getEnclosingCallable ( ) )
956+ sameCallable ( mid , result )
952957 )
953958 }
954959}
You can’t perform that action at this time.
0 commit comments