[PATCH] D46403: [CFI] Force LLVM to die if the implicit blacklist files cannot be found.

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 4 12:25:28 PDT 2018


vsk added inline comments.


================
Comment at: lib/Driver/SanitizerArgs.cpp:118
       BlacklistFiles.push_back(Path.str());
+    else if (BL.Mask == CFI)
+      D.Diag(clang::diag::err_drv_no_such_file) << Path;
----------------
CFI can be enabled with other sanitizers, such as ubsan. I think you'll need 'Mask & CFI' here. It'd be great to have a test for this case, too (i.e -fsanitize=cfi,undefined -resource-dir=/dev/null should also give you this diagnostic).


================
Comment at: test/Driver/fsanitize-blacklist.c:65
 
+// If cfi_blacklist.txt cannot be found in the resource dir, driver should fail.
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -resource-dir=/dev/null %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MISSING-CFI-BLACKLIST
----------------
It'd be more helpful for readers if this comment were in the source, at the point where the diagnostic is emitted.


https://reviews.llvm.org/D46403





More information about the cfe-commits mailing list