Skip to content

Commit 622b326

Browse files
authored
Python: Prevent magic/inlining in getCase
This is a simplified version of github#8028 consisting of just the `nomagic` fix.
1 parent 844815a commit 622b326

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

python/ql/lib/semmle/python/Patterns.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Pattern extends Pattern_, AstNode {
1010
override Scope getScope() { result = this.getCase().getScope() }
1111

1212
/** Gets the case statement containing this pattern */
13+
pragma[nomagic]
1314
Case getCase() { result.contains(this) }
1415

1516
override string toString() { result = "Pattern" }

0 commit comments

Comments
 (0)