[PATCH] D50250: [clang][ubsan] Implicit Conversion Sanitizer - integer sign change - clang part

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 3 06:50:43 PDT 2018


erichkeane added inline comments.


================
Comment at: lib/CodeGen/CGExprScalar.cpp:2004
+    if (auto *ICE = dyn_cast<ImplicitCastExpr>(CE)) {
+      if (CGF.SanOpts.hasOneOf(SanitizerKind::ImplicitConversion) &&
+          !ICE->isPartOfExplicitCast()) {
----------------
lebedev.ri wrote:
> erichkeane wrote:
> > Is this an error?  You swapped a 'has' with a 'hasOneOf' but only listed a single thing.
> `ImplicitConversion` is a *group*, which includes `ImplicitIntegerTruncation` and `ImplicitIntegerSignChange`.
> So `hasOneOf(group)` checks that at least one check of the group is enabled.
> No, this is correct, else the tests would break.
Ah! I missed that subtly, just LOOKed odd.


Repository:
  rC Clang

https://reviews.llvm.org/D50250





More information about the cfe-commits mailing list