Skip to content

Commit aa4280d

Browse files
committed
comment
Created using spr 1.3.4
1 parent 5a542a6 commit aa4280d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,11 +2719,12 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
27192719

27202720
auto GetMinMaxUnsigned = [&](Value *V, Value *S) {
27212721
if (IsSigned) {
2722-
// Map from signed range to unsigned range. Relation A vs B should be
2723-
// preserved if checked with `getUnsignedPredicate()`.
2724-
// Calcualting Amin, Amax, Bmin, Bmax also will not be affected, as they
2725-
// are created by effectively adding/substructing from A or B a value,
2726-
// derived from shadow, which can't result in overflow.
2722+
// Sign-flip to map from signed range to unsigned range. Relation A vs B
2723+
// should be preserved, if checked with `getUnsignedPredicate()`.
2724+
// Relationship between Amin, Amax, Bmin, Bmax also will not be
2725+
// affected, as they are created by effectively adding/substructing from
2726+
// A or B a value, derived from shadow, which can't result in overflow,
2727+
// before or after sign flip.
27272728
APInt MinVal =
27282729
APInt::getSignedMinValue(V->getType()->getScalarSizeInBits());
27292730
V = IRB.CreateXor(V, ConstantInt::get(V->getType(), MinVal));

0 commit comments

Comments
 (0)