File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2055,6 +2055,13 @@ class ChiInstruction extends Instruction {
2055
2055
final predicate getUpdatedInterval ( int startBit , int endBit ) {
2056
2056
Construction:: getIntervalUpdatedByChi ( this , startBit , endBit )
2057
2057
}
2058
+
2059
+ /**
2060
+ * Holds if the `ChiPartialOperand` totally, but not exactly, overlaps with the `ChiTotalOperand`.
2061
+ * This means that the `ChiPartialOperand` will not override the entire memory associated with the
2062
+ * `ChiTotalOperand`.
2063
+ */
2064
+ final predicate isPartialUpdate ( ) { Construction:: chiOnlyPartiallyUpdatesLocation ( this ) }
2058
2065
}
2059
2066
2060
2067
/**
Original file line number Diff line number Diff line change @@ -178,6 +178,22 @@ private module Cached {
178
178
)
179
179
}
180
180
181
+ /**
182
+ * Holds if the `ChiPartialOperand` totally, but not exactly, overlaps with the `ChiTotalOperand`.
183
+ * This means that the `ChiPartialOperand` will not override the entire memory associated with the
184
+ * `ChiTotalOperand`.
185
+ */
186
+ cached
187
+ predicate chiOnlyPartiallyUpdatesLocation ( ChiInstruction chi ) {
188
+ exists ( Alias:: MemoryLocation location , OldInstruction oldInstruction |
189
+ oldInstruction = getOldInstruction ( chi .getPartial ( ) ) and
190
+ location = Alias:: getResultMemoryLocation ( oldInstruction )
191
+ |
192
+ Alias:: getStartBitOffset ( location ) != 0 or
193
+ Alias:: getEndBitOffset ( location ) != 8 * location .getType ( ) .getByteSize ( )
194
+ )
195
+ }
196
+
181
197
/**
182
198
* Holds if `instr` is part of a cycle in the operand graph that doesn't go
183
199
* through a phi instruction and therefore should be impossible.
You can’t perform that action at this time.
0 commit comments