[PATCH] [Patch] UBsan: Type-based blacklisting

Alexey Samsonov vonosmas at gmail.com
Wed Jul 9 17:55:45 PDT 2014


================
Comment at: lib/CodeGen/CGExpr.cpp:539
@@ -539,2 +539,2 @@
     llvm::raw_svector_ostream Out(MangledName);
     CGM.getCXXABI().getMangleContext().mangleCXXRTTI(Ty.getUnqualifiedType(),
----------------
Nit: please upload the diffs with more context. This can be done with e.g. "arc" commandline tool (see http://llvm.org/docs/Phabricator.html). This change is probably fine, though, as it's local.

================
Comment at: lib/CodeGen/CGExpr.cpp:544
@@ +543,3 @@
+    // Blacklist based on the mangled types
+    if (!CGM.getSanitizerBlacklist().isIn(Out.str())) {
+      llvm::hash_code TypeHash = hash_value(Out.str());
----------------
Now you shouldn't have generic "isIn(StringRef)" machinery in SanitizerBlacklist. Instead, it would be better to extend SanitizerBlacklist (which is now moved to lib/CodeGen/SanitizerBlacklist.h) with function like "isBlacklistedType(StringRef MangledTypeName)" and use it here.

http://reviews.llvm.org/D4407






More information about the cfe-commits mailing list