Skip to content

Commit 6257bed

Browse files
committed
Sync OverlayXml.qll
1 parent 38a1bb0 commit 6257bed

File tree

4 files changed

+32
-28
lines changed

4 files changed

+32
-28
lines changed

csharp/ql/lib/semmle/code/csharp/internal/OverlayXml.qll

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ module;
77
*/
88
private predicate isOverlay() { databaseMetadata("isOverlay", "true") }
99

10-
private @file getXmlFile(@xmllocatable locatable) {
11-
exists(@location_default location | xmllocations(locatable, location) |
12-
locations_default(location, result, _, _, _, _)
10+
private string getXmlFile(@xmllocatable locatable) {
11+
exists(@location_default location, @file file | xmllocations(locatable, location) |
12+
locations_default(location, file, _, _, _, _) and
13+
files(file, result)
1314
)
1415
}
1516

16-
private @file getXmlFileInBase(@xmllocatable locatable) {
17+
private string getXmlFileInBase(@xmllocatable locatable) {
1718
not isOverlay() and
1819
result = getXmlFile(locatable)
1920
}
@@ -22,7 +23,7 @@ private @file getXmlFileInBase(@xmllocatable locatable) {
2223
* Holds if the given `file` was extracted as part of the overlay and was extracted by the HTML/XML
2324
* extractor.
2425
*/
25-
private predicate overlayXmlExtracted(@file file) {
26+
private predicate overlayXmlExtracted(string file) {
2627
isOverlay() and
2728
exists(@xmllocatable locatable |
2829
not files(locatable, _) and not xmlNs(locatable, _, _, _) and file = getXmlFile(locatable)
@@ -35,8 +36,8 @@ private predicate overlayXmlExtracted(@file file) {
3536
*/
3637
overlay[discard_entity]
3738
private predicate discardXmlLocatable(@xmllocatable locatable) {
38-
exists(@file file | file = getXmlFileInBase(locatable) |
39-
exists(string path | files(file, path) | overlayChangedFiles(path))
39+
exists(string file | file = getXmlFileInBase(locatable) |
40+
overlayChangedFiles(file)
4041
or
4142
// The HTML/XML extractor is currently not incremental and may extract more files than those
4243
// included in overlayChangedFiles.

go/ql/lib/semmle/go/internal/OverlayXml.qll

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ module;
77
*/
88
private predicate isOverlay() { databaseMetadata("isOverlay", "true") }
99

10-
private @file getXmlFile(@xmllocatable locatable) {
11-
exists(@location_default location | xmllocations(locatable, location) |
12-
locations_default(location, result, _, _, _, _)
10+
private string getXmlFile(@xmllocatable locatable) {
11+
exists(@location_default location, @file file | xmllocations(locatable, location) |
12+
locations_default(location, file, _, _, _, _) and
13+
files(file, result)
1314
)
1415
}
1516

16-
private @file getXmlFileInBase(@xmllocatable locatable) {
17+
private string getXmlFileInBase(@xmllocatable locatable) {
1718
not isOverlay() and
1819
result = getXmlFile(locatable)
1920
}
@@ -22,7 +23,7 @@ private @file getXmlFileInBase(@xmllocatable locatable) {
2223
* Holds if the given `file` was extracted as part of the overlay and was extracted by the HTML/XML
2324
* extractor.
2425
*/
25-
private predicate overlayXmlExtracted(@file file) {
26+
private predicate overlayXmlExtracted(string file) {
2627
isOverlay() and
2728
exists(@xmllocatable locatable |
2829
not files(locatable, _) and not xmlNs(locatable, _, _, _) and file = getXmlFile(locatable)
@@ -35,8 +36,8 @@ private predicate overlayXmlExtracted(@file file) {
3536
*/
3637
overlay[discard_entity]
3738
private predicate discardXmlLocatable(@xmllocatable locatable) {
38-
exists(@file file | file = getXmlFileInBase(locatable) |
39-
exists(string path | files(file, path) | overlayChangedFiles(path))
39+
exists(string file | file = getXmlFileInBase(locatable) |
40+
overlayChangedFiles(file)
4041
or
4142
// The HTML/XML extractor is currently not incremental and may extract more files than those
4243
// included in overlayChangedFiles.

javascript/ql/lib/semmle/javascript/internal/OverlayXml.qll

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ module;
77
*/
88
private predicate isOverlay() { databaseMetadata("isOverlay", "true") }
99

10-
private @file getXmlFile(@xmllocatable locatable) {
11-
exists(@location_default location | xmllocations(locatable, location) |
12-
locations_default(location, result, _, _, _, _)
10+
private string getXmlFile(@xmllocatable locatable) {
11+
exists(@location_default location, @file file | xmllocations(locatable, location) |
12+
locations_default(location, file, _, _, _, _) and
13+
files(file, result)
1314
)
1415
}
1516

16-
private @file getXmlFileInBase(@xmllocatable locatable) {
17+
private string getXmlFileInBase(@xmllocatable locatable) {
1718
not isOverlay() and
1819
result = getXmlFile(locatable)
1920
}
@@ -22,7 +23,7 @@ private @file getXmlFileInBase(@xmllocatable locatable) {
2223
* Holds if the given `file` was extracted as part of the overlay and was extracted by the HTML/XML
2324
* extractor.
2425
*/
25-
private predicate overlayXmlExtracted(@file file) {
26+
private predicate overlayXmlExtracted(string file) {
2627
isOverlay() and
2728
exists(@xmllocatable locatable |
2829
not files(locatable, _) and not xmlNs(locatable, _, _, _) and file = getXmlFile(locatable)
@@ -35,8 +36,8 @@ private predicate overlayXmlExtracted(@file file) {
3536
*/
3637
overlay[discard_entity]
3738
private predicate discardXmlLocatable(@xmllocatable locatable) {
38-
exists(@file file | file = getXmlFileInBase(locatable) |
39-
exists(string path | files(file, path) | overlayChangedFiles(path))
39+
exists(string file | file = getXmlFileInBase(locatable) |
40+
overlayChangedFiles(file)
4041
or
4142
// The HTML/XML extractor is currently not incremental and may extract more files than those
4243
// included in overlayChangedFiles.

python/ql/lib/semmle/python/internal/OverlayXml.qll

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ module;
77
*/
88
private predicate isOverlay() { databaseMetadata("isOverlay", "true") }
99

10-
private @file getXmlFile(@xmllocatable locatable) {
11-
exists(@location_default location | xmllocations(locatable, location) |
12-
locations_default(location, result, _, _, _, _)
10+
private string getXmlFile(@xmllocatable locatable) {
11+
exists(@location_default location, @file file | xmllocations(locatable, location) |
12+
locations_default(location, file, _, _, _, _) and
13+
files(file, result)
1314
)
1415
}
1516

16-
private @file getXmlFileInBase(@xmllocatable locatable) {
17+
private string getXmlFileInBase(@xmllocatable locatable) {
1718
not isOverlay() and
1819
result = getXmlFile(locatable)
1920
}
@@ -22,7 +23,7 @@ private @file getXmlFileInBase(@xmllocatable locatable) {
2223
* Holds if the given `file` was extracted as part of the overlay and was extracted by the HTML/XML
2324
* extractor.
2425
*/
25-
private predicate overlayXmlExtracted(@file file) {
26+
private predicate overlayXmlExtracted(string file) {
2627
isOverlay() and
2728
exists(@xmllocatable locatable |
2829
not files(locatable, _) and not xmlNs(locatable, _, _, _) and file = getXmlFile(locatable)
@@ -35,8 +36,8 @@ private predicate overlayXmlExtracted(@file file) {
3536
*/
3637
overlay[discard_entity]
3738
private predicate discardXmlLocatable(@xmllocatable locatable) {
38-
exists(@file file | file = getXmlFileInBase(locatable) |
39-
exists(string path | files(file, path) | overlayChangedFiles(path))
39+
exists(string file | file = getXmlFileInBase(locatable) |
40+
overlayChangedFiles(file)
4041
or
4142
// The HTML/XML extractor is currently not incremental and may extract more files than those
4243
// included in overlayChangedFiles.

0 commit comments

Comments
 (0)