Skip to content

Commit d7094a9

Browse files
committed
Overlay: Add discarding of all Java base properties
1 parent b573246 commit d7094a9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,21 @@ private predicate discardReferableLocatable(@locatable el) {
8181
not drl.existsInOverlay()
8282
)
8383
}
84+
85+
overlay[local]
86+
private predicate baseConfigLocatable(@configLocatable l) { not isOverlay() and l = l }
87+
88+
overlay[local]
89+
private predicate overlayHasConfigLocatables() {
90+
isOverlay() and
91+
exists(@configLocatable el)
92+
}
93+
94+
overlay[discard_entity]
95+
private predicate discardBaseConfigLocatable(@configLocatable el) {
96+
// The properties extractor is currently not incremental, so if
97+
// the overlay contains any config locatables, the overlay should
98+
// contain a full extraction and all config locatables from base
99+
// should be discarded.
100+
baseConfigLocatable(el) and overlayHasConfigLocatables()
101+
}

0 commit comments

Comments
 (0)