[PATCH] D34121: [ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 12 15:33:49 PDT 2017
efriedma added a comment.
Looks okay, but I haven't been reviewing this series of patches closely, so I could be missing something.
================
Comment at: lib/CodeGen/CGExprScalar.cpp:3974
ValidGEP = Builder.CreateAnd(PosOrZeroValid, NoOffsetOverflow);
+ } else if (!SignedIndices && IsSubtraction) {
+ auto *NegOrZeroValid = Builder.CreateICmpULE(ComputedGEP, IntPtr);
----------------
Please make this an "else" rather than an "else if" (you can assert the inside the else body if it's helpful).
https://reviews.llvm.org/D34121
More information about the cfe-commits
mailing list