Merge pull request #18859 from jketema/is-before

C++: Fix join-order problem with `isBefore`
This commit is contained in:
Jeroen Ketema
2025-02-25 15:27:43 +01:00
committed by GitHub

View File

@@ -75,7 +75,10 @@ class Location extends @location {
/** Holds if `this` comes on a line strictly before `l`. */
pragma[inline]
predicate isBefore(Location l) { this.isBefore(l, false) }
predicate isBefore(Location l) {
this.getFile() = l.getFile() and
this.getEndLine() < l.getStartLine()
}
/**
* Holds if `this` comes strictly before `l`. The boolean `sameLine` is