C++: Fix comment and prevent false positives on chiOnlyPartiallyUpdatesLocation when Alias::getEndBitOffset doesn't have known value.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-03-05 08:53:24 +01:00
parent bd842403c8
commit c86fc223b9
4 changed files with 15 additions and 11 deletions

View File

@@ -629,7 +629,11 @@ MemoryLocation getOperandMemoryLocation(MemoryOperand operand) {
}
/** Gets the start bit offset of a `MemoryLocation`, if any. */
int getStartBitOffset(VariableMemoryLocation location) { result = location.getStartBitOffset() }
int getStartBitOffset(VariableMemoryLocation location) {
result = location.getStartBitOffset() and Ints::hasValue(result)
}
/** Gets the end bit offset of a `MemoryLocation`, if any. */
int getEndBitOffset(VariableMemoryLocation location) { result = location.getEndBitOffset() }
int getEndBitOffset(VariableMemoryLocation location) {
result = location.getEndBitOffset() and Ints::hasValue(result)
}

View File

@@ -179,9 +179,9 @@ private module Cached {
}
/**
* Holds if the `ChiPartialOperand` totally, but not exactly, overlaps with the `ChiTotalOperand`.
* This means that the `ChiPartialOperand` will not override the entire memory associated with the
* `ChiTotalOperand`.
* Holds if the `ChiPartialOperand` only partially overlaps with the `ChiTotalOperand`.
* This means that the `ChiPartialOperand` will not override the entire memory associated
* with the `ChiTotalOperand`.
*/
cached
predicate chiOnlyPartiallyUpdatesLocation(ChiInstruction chi) {

View File

@@ -179,9 +179,9 @@ private module Cached {
}
/**
* Holds if the `ChiPartialOperand` totally, but not exactly, overlaps with the `ChiTotalOperand`.
* This means that the `ChiPartialOperand` will not override the entire memory associated with the
* `ChiTotalOperand`.
* Holds if the `ChiPartialOperand` only partially overlaps with the `ChiTotalOperand`.
* This means that the `ChiPartialOperand` will not override the entire memory associated
* with the `ChiTotalOperand`.
*/
cached
predicate chiOnlyPartiallyUpdatesLocation(ChiInstruction chi) {

View File

@@ -179,9 +179,9 @@ private module Cached {
}
/**
* Holds if the `ChiPartialOperand` totally, but not exactly, overlaps with the `ChiTotalOperand`.
* This means that the `ChiPartialOperand` will not override the entire memory associated with the
* `ChiTotalOperand`.
* Holds if the `ChiPartialOperand` only partially overlaps with the `ChiTotalOperand`.
* This means that the `ChiPartialOperand` will not override the entire memory associated
* with the `ChiTotalOperand`.
*/
cached
predicate chiOnlyPartiallyUpdatesLocation(ChiInstruction chi) {