File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
cpp/ql/lib/semmle/code/cpp/internal Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -64,17 +64,27 @@ private string getMultiLocationFilePath(@element e) {
6464overlay [ local]
6565private predicate isBase ( ) { not isOverlay ( ) }
6666
67+ /**
68+ * Holds if `path` was extracted in the overlay database.
69+ */
70+ overlay [ local]
71+ private predicate overlayHasFile ( string path ) {
72+ isOverlay ( ) and
73+ files ( _, path ) and
74+ path != ""
75+ }
76+
6777/**
6878 * Discards an element from the base variant if:
69- * - It has a single location in a changed file, or
70- * - All of its locations are in changed files.
79+ * - It has a single location in a file extracted in the overlay , or
80+ * - All of its locations are in files extracted in the overlay .
7181 */
7282overlay [ discard_entity]
7383private predicate discardElement ( @element e ) {
7484 isBase ( ) and
7585 (
76- overlayChangedFiles ( getSingleLocationFilePath ( e ) )
86+ overlayHasFile ( getSingleLocationFilePath ( e ) )
7787 or
78- forex ( string path | path = getMultiLocationFilePath ( e ) | overlayChangedFiles ( path ) )
88+ forex ( string path | path = getMultiLocationFilePath ( e ) | overlayHasFile ( path ) )
7989 )
8090}
You can’t perform that action at this time.
0 commit comments