[PATCH] Change how we deal with (implicit) -fno-rtti + -fsanitize=vptr

Alexey Samsonov vonosmas at gmail.com
Wed Feb 18 16:29:44 PST 2015


LGTM. Feel free to submit this after addressing comments below. Thank you for working on this!


================
Comment at: include/clang/Driver/ToolChain.h:68
@@ +67,3 @@
+  // We need to initialize CachedRTTIArg before CachedRTTIMode
+  const llvm::opt::Arg *CachedRTTIArg;
+  const RTTIMode CachedRTTIMode;
----------------
Looks like it should be
  const llvm::opt::Arg *const CachedRTTIArg;

================
Comment at: lib/Driver/SanitizerArgs.cpp:217
@@ +216,3 @@
+        // Take out the Vptr sanitizer from the enabled sanitizers
+        AllRemove |= static_cast<unsigned>(SanitizeKind::Vptr);
+      }
----------------
Remove static_cast.

================
Comment at: lib/Driver/SanitizerArgs.cpp:236
@@ -211,1 +235,3 @@
 
+  // We disable the vptr sanitizer if rtti is disabled and -fsanitize=undefined
+  // was passed.
----------------
We disable the vptr sanitizer if it was enabled by group expansion, but RTTI is disabled.

================
Comment at: lib/Driver/SanitizerArgs.cpp:241
@@ +240,3 @@
+       RTTIMode == ToolChain::RM_DisabledExplicitly)) {
+    // Make sure Kinds is up to date too.
+    Kinds &= ~SanitizeKind::Vptr;
----------------
Remove this comment.

================
Comment at: lib/Driver/Tools.cpp:1995
@@ +1994,3 @@
+          D.Diag(diag::warn_drv_enabling_rtti_with_exceptions);
+      }
+
----------------
add an assert that RTTIMode is not DisabledImplicitly?

http://reviews.llvm.org/D7525

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list