Skip to content

Commit 508055f

Browse files
committed
C#: Add a few pragma[nomagic]
1 parent 1e7ee8d commit 508055f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ module AssignableDefinitions {
567567
* entry point of `p`'s callable to basic block `bb` without passing through
568568
* any assignments to `p`.
569569
*/
570+
pragma[nomagic]
570571
private predicate parameterReachesWithoutDef(Parameter p, ControlFlow::BasicBlock bb) {
571572
forall(AssignableDefinition def | basicBlockRefParamDef(bb, p, def) |
572573
isUncertainRefCall(def.getTargetAccess())

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ predicate implements(Virtualizable m1, Virtualizable m2, ValueOrRefType t) {
6565
* `I.M()` is compatible with `A.M()` for types `A` and `B`, but not
6666
* for type `C`, because `C.M()` conflicts.
6767
*/
68+
pragma[nomagic]
6869
private Virtualizable getAnImplementedInterfaceMemberForSubType(Virtualizable m, ValueOrRefType t) {
6970
result = getACompatibleInterfaceMember(m) and
7071
t = m.getDeclaringType()
@@ -86,6 +87,7 @@ private predicate hasMemberCompatibleWithInterfaceMember(ValueOrRefType t, Virtu
8687
* signature, and where `m` can potentially be accessed when
8788
* the interface member is accessed.
8889
*/
90+
pragma[nomagic]
8991
private Virtualizable getACompatibleInterfaceMember(Virtualizable m) {
9092
result = getACompatibleInterfaceMemberAux(m) and
9193
(
@@ -97,12 +99,14 @@ private Virtualizable getACompatibleInterfaceMember(Virtualizable m) {
9799
)
98100
}
99101

102+
pragma[nomagic]
100103
private Virtualizable getACompatibleExplicitInterfaceMember(Virtualizable m, ValueOrRefType declType) {
101104
result = getACompatibleInterfaceMemberAux(m) and
102105
declType = m.getDeclaringType() and
103106
m.implementsExplicitInterface()
104107
}
105108

109+
pragma[nomagic]
106110
private Virtualizable getACompatibleInterfaceMemberAux(Virtualizable m) {
107111
result = getACompatibleInterfaceAccessor(m) or
108112
result = getACompatibleInterfaceIndexer(m) or

0 commit comments

Comments
 (0)