Skip to content

Commit 0739c03

Browse files
committed
Overlay: Add discarding of base XML locatables for Java
1 parent d7094a9 commit 0739c03

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

java/ql/lib/semmle/code/java/Overlay.qll

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,23 @@ private predicate discardBaseConfigLocatable(@configLocatable el) {
9999
// should be discarded.
100100
baseConfigLocatable(el) and overlayHasConfigLocatables()
101101
}
102+
103+
overlay[local]
104+
private predicate baseXmlLocatable(@xmllocatable l) {
105+
not isOverlay() and not files(l, _) and not xmlNs(l, _, _, _)
106+
}
107+
108+
overlay[local]
109+
private predicate overlayHasXmlLocatable() {
110+
isOverlay() and
111+
exists(@xmllocatable l | not files(l, _) and not xmlNs(l, _, _, _))
112+
}
113+
114+
overlay[discard_entity]
115+
private predicate discardBaseXmlLocatable(@xmllocatable el) {
116+
// The XML extractor is currently not incremental, so if
117+
// the overlay contains any XML locatables, the overlay should
118+
// contain a full extraction and all XML locatables from base
119+
// should be discarded.
120+
baseXmlLocatable(el) and overlayHasXmlLocatable()
121+
}

0 commit comments

Comments
 (0)