We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f45305e + a18a4fb commit 0e67aa5Copy full SHA for 0e67aa5
go/ql/lib/semmle/go/internal/Locations.qll
@@ -11,12 +11,19 @@ newtype TLocation =
11
TSynthLocation(string filepath, int startline, int startcolumn, int endline, int endcolumn) {
12
any(DataFlow::Node n).hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and
13
// avoid overlap with existing DB locations
14
- not exists(File f |
15
- locations_default(_, f, startline, startcolumn, endline, endcolumn) and
16
- f.getAbsolutePath() = filepath
17
- )
+ not existingDBLocation(filepath, startline, startcolumn, endline, endcolumn)
18
}
19
+pragma[nomagic]
+private predicate existingDBLocation(
+ string filepath, int startline, int startcolumn, int endline, int endcolumn
20
+) {
21
+ exists(File f |
22
+ locations_default(_, f, startline, startcolumn, endline, endcolumn) and
23
+ f.getAbsolutePath() = filepath
24
+ )
25
+}
26
+
27
/**
28
* A location as given by a file, a start line, a start column,
29
* an end line, and an end column.
0 commit comments