Skip to content

Commit be175aa

Browse files
committed
C#: Prevent bad magic in a few predicates.
1 parent 7bc16a3 commit be175aa

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

csharp/ql/lib/semmle/code/csharp/commons/ComparisonTest.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ class ComparisonTest extends TComparisonTest {
305305
}
306306

307307
/** Gets an argument of this comparison test. */
308+
pragma[nomagic]
308309
Expr getAnArgument() {
309310
result = this.getFirstArgument() or
310311
result = this.getSecondArgument()

csharp/ql/lib/semmle/code/csharp/exprs/Call.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Call extends Expr, @call {
4040
Callable getTarget() { none() }
4141

4242
/** Gets the `i`th argument to this call, if any. */
43+
pragma[nomagic]
4344
Expr getArgument(int i) { result = this.getChild(i) and i >= 0 }
4445

4546
/**

0 commit comments

Comments
 (0)