Skip to content

Commit cf76d31

Browse files
tamasvajkhvitved
authored andcommitted
C#: Add nomagic pragmas to fix performance issues
1 parent b20a08d commit cf76d31

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

csharp/ql/src/semmle/code/csharp/Variable.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, Top
237237
* The assigned arguments to `x` are `1` and `4`, the assigned argument to
238238
* `y` is `5`, and the assigned arguments to `z` are `3` and `6`, respectively.
239239
*/
240+
pragma[nomagic]
240241
Expr getAnAssignedArgument() { result = getCallable().getACall().getArgumentForParameter(this) }
241242

242243
/** Holds if this parameter is potentially overwritten in the body of its callable. */

csharp/ql/src/semmle/code/csharp/commons/StructuralComparison.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ abstract class StructuralComparisonConfiguration extends string {
7777

7878
private predicate sameByValue(Expr x, Expr y) { sameByValueAux(x, y, y.getValue()) }
7979

80-
pragma[noinline]
80+
pragma[nomagic]
8181
private predicate sameByValueAux(Expr x, Expr y, string value) {
8282
candidateInternal(x, y) and
8383
value = x.getValue()

csharp/ql/src/semmle/code/csharp/controlflow/Guards.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ module Internal {
12481248
)
12491249
}
12501250

1251+
pragma[nomagic]
12511252
private Expr getAnEqualityCheckVal(Expr e, AbstractValue v, AbstractValue vExpr) {
12521253
result = getAnEqualityCheck(e, v, vExpr.getAnExpr())
12531254
}

0 commit comments

Comments
 (0)