[PATCH] [RFC] Introduce support for multiple sanitizer blacklists (Clang side).

Alexey Samsonov vonosmas at gmail.com
Thu Aug 7 16:35:43 PDT 2014


Support for adding special case list entries in commandline seems an overkill to me. Now, if you presumably need logic to dynamically construct special case list from object files, I don't see why Clang's codegen will be a good place for it. It won't even use this list, only pass it to the DFSan backend...

================
Comment at: lib/Driver/SanitizerArgs.cpp:118
@@ -137,1 +117,3 @@
+  // blacklist in the resource directory.
+  if (!Args.hasArg(options::OPT_fno_sanitize_blacklist)) {
     std::string BLPath;
----------------
Hm. So now -fno-sanitize-blacklist only disables the default blacklist, but not blacklists specified in -fsanitize-blacklist= arguments? This looks weird. I'd suggest the following semantics:
  * default blacklist in resource directory is implicitly enabled.
  * -fsanitize-blacklist= specifes one more blacklist to use
  * -fno-sanitize-blacklist - discards all blacklists previously defined in the command line, and the default blacklist.

That is,
  BLSet.insert(DefaultBlacklist);
  foreach (arg)
    if arg is -fsanitize-blacklist=, insert the blacklist into BLSet
    else if arg is -fno-sanitize-blacklist, clear BLSet.

http://reviews.llvm.org/D4547






More information about the cfe-commits mailing list