Skip to content

Commit 33ecb9b

Browse files
committed
CPP: Pull rank into predicate for RTJO.
1 parent ae2fd52 commit 33ecb9b

File tree

1 file changed

+7
-2
lines changed
  • cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal

1 file changed

+7
-2
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasedSSA.qll

+7-2
Original file line numberDiff line numberDiff line change
@@ -815,10 +815,15 @@ private predicate isRelatableMemoryLocation(VariableMemoryLocation vml) {
815815
vml.getStartBitOffset() != Ints::unknown()
816816
}
817817

818+
pragma[noinline]
819+
private int getRank(VirtualVariable vvar, IntValue offset) {
820+
offset = rank[result](IntValue offset_ | isRelevantOffset(vvar, offset_))
821+
}
822+
818823
private predicate isCoveredOffset(Allocation var, int offsetRank, VariableMemoryLocation vml) {
819824
exists(int startRank, int endRank, VirtualVariable vvar |
820-
vml.getStartBitOffset() = rank[startRank](IntValue offset_ | isRelevantOffset(vvar, offset_)) and
821-
vml.getEndBitOffset() = rank[endRank](IntValue offset_ | isRelevantOffset(vvar, offset_)) and
825+
startRank = getRank(vvar, vml.getStartBitOffset()) and
826+
endRank = getRank(vvar, vml.getEndBitOffset()) and
822827
var = vml.getAnAllocation() and
823828
vvar = vml.getVirtualVariable() and
824829
isRelatableMemoryLocation(vml) and

0 commit comments

Comments
 (0)