Skip to content

Commit 0d538ec

Browse files
committed
Java: Hnalde global files as exceptions rather than annotating them
This allows us to merge them without redundent annoations for now.
1 parent 39d6db8 commit 0d538ec

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

config/add-overlay-annotations.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ def insert_overlay_caller_annotations(lines):
177177
out_lines.append(line)
178178
return out_lines
179179

180+
explicitly_global = set([
181+
"java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll",
182+
"java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll",
183+
"java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll",
184+
"java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll",
185+
])
180186

181187
def annotate_as_appropriate(filename, lines):
182188
'''
@@ -196,6 +202,9 @@ def annotate_as_appropriate(filename, lines):
196202
((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and
197203
any("implements DataFlow::ConfigSig" in line for line in lines))):
198204
return None
205+
elif filename in explicitly_global:
206+
# These files are explicitly global and should not be annotated.
207+
return None
199208
elif not any(line for line in lines if line.strip()):
200209
return None
201210

java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* data flow check for lambdas, anonymous classes, and other sufficiently
66
* private classes where all object instantiations are accounted for.
77
*/
8-
overlay[global]
9-
module;
108

119
import java
1210
private import VirtualDispatch

java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* The set of dispatch targets for `Object.toString()` calls are reduced based
77
* on possible data flow from objects of more specific types to the qualifier.
88
*/
9-
overlay[global]
10-
module;
119

1210
import java
1311
private import VirtualDispatch

java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* Provides predicates for reasoning about runtime call targets through virtual
33
* dispatch.
44
*/
5-
overlay[global]
6-
module;
75

86
import java
97
import semmle.code.java.dataflow.TypeFlow

java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* Provides a module to check whether two `ParameterizedType`s are unifiable.
33
*/
4-
overlay[global]
5-
module;
64

75
import java
86

0 commit comments

Comments
 (0)