mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
C#: Add nomagic pragmas to fix performance issues
This commit is contained in:
@@ -237,6 +237,7 @@ class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, Top
|
|||||||
* The assigned arguments to `x` are `1` and `4`, the assigned argument to
|
* The assigned arguments to `x` are `1` and `4`, the assigned argument to
|
||||||
* `y` is `5`, and the assigned arguments to `z` are `3` and `6`, respectively.
|
* `y` is `5`, and the assigned arguments to `z` are `3` and `6`, respectively.
|
||||||
*/
|
*/
|
||||||
|
pragma[nomagic]
|
||||||
Expr getAnAssignedArgument() { result = getCallable().getACall().getArgumentForParameter(this) }
|
Expr getAnAssignedArgument() { result = getCallable().getACall().getArgumentForParameter(this) }
|
||||||
|
|
||||||
/** Holds if this parameter is potentially overwritten in the body of its callable. */
|
/** Holds if this parameter is potentially overwritten in the body of its callable. */
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ abstract class StructuralComparisonConfiguration extends string {
|
|||||||
|
|
||||||
private predicate sameByValue(Expr x, Expr y) { sameByValueAux(x, y, y.getValue()) }
|
private predicate sameByValue(Expr x, Expr y) { sameByValueAux(x, y, y.getValue()) }
|
||||||
|
|
||||||
pragma[noinline]
|
pragma[nomagic]
|
||||||
private predicate sameByValueAux(Expr x, Expr y, string value) {
|
private predicate sameByValueAux(Expr x, Expr y, string value) {
|
||||||
candidateInternal(x, y) and
|
candidateInternal(x, y) and
|
||||||
value = x.getValue()
|
value = x.getValue()
|
||||||
|
|||||||
@@ -1248,6 +1248,7 @@ module Internal {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pragma[nomagic]
|
||||||
private Expr getAnEqualityCheckVal(Expr e, AbstractValue v, AbstractValue vExpr) {
|
private Expr getAnEqualityCheckVal(Expr e, AbstractValue v, AbstractValue vExpr) {
|
||||||
result = getAnEqualityCheck(e, v, vExpr.getAnExpr())
|
result = getAnEqualityCheck(e, v, vExpr.getAnExpr())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user