Skip to content

Commit 8351cb4

Browse files
committed
Overlay: Add discarding of base XML locatables for Java
1 parent aaf51b2 commit 8351cb4

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy