Skip to content

Commit 7d5fbf5

Browse files
committed
ruby: first draft of thread-unsafe modification
1 parent 5d3a541 commit 7d5fbf5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import ruby
2+
import codeql.ruby.ast.Expr
3+
import codeql.ruby.ast.Constant
4+
import codeql.ruby.ast.Variable
5+
6+
predicate relevantModification(Expr e) {
7+
e instanceof ClassVariableWriteAccess
8+
or
9+
exists(e.(ConstantAssignment).getScopeExpr())
10+
}
11+
12+
from Expr e
13+
where relevantModification(e) and exists(e.getEnclosingCallable())
14+
select e

0 commit comments

Comments
 (0)