Skip to content

Commit e1a7a1d

Browse files
committed
C/C++ overlay: fix failing header_dependency test
1 parent c16d6a4 commit e1a7a1d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cpp/ql/lib/semmle/code/cpp/internal/Overlay.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ private predicate discardElement(@element e) {
5757
// Finally, we have to make sure that base shouldn't retain it.
5858
// If it is reachable from a base source file, then that is
5959
// sufficient unless either the base source file has changed (in
60-
// particular, been deleted) or the overlay has redefined the TRAP
61-
// file or tag it is in.
60+
// particular, been deleted), or the overlay has redefined the TRAP
61+
// file or tag it is in, or the overlay runner has re-extracted the same
62+
// source file (e.g. because a header it includes has changed).
6263
forall(@trap_or_tag t, string sourceFile |
6364
locallyInTrapOrTag(false, e, t) and
6465
locallyReachableTrapOrTag(false, sourceFile, t)
6566
|
6667
overlayChangedFiles(sourceFile) or
67-
locallyReachableTrapOrTag(true, _, t)
68+
locallyReachableTrapOrTag(true, _, t) or
69+
locallyReachableTrapOrTag(true, sourceFile, _)
6870
)
6971
}

0 commit comments

Comments
 (0)