[PATCH] D34121: [ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 14 08:31:57 PDT 2017


aprantl added inline comments.


================
Comment at: lib/CodeGen/CGExpr.cpp:3010
+    return CGF.EmitCheckedInBoundsGEP(ptr, indices, signedIndices,
+                                      /*IsSubtraction=*/false, loc, name);
   } else {
----------------
Might want to define an

`enum { NotSubtraction = false, IsSubtraction = true }` in the header. We do this in other places.


https://reviews.llvm.org/D34121





More information about the cfe-commits mailing list