[PATCH] D37860: [MSan] Enable use-after-dtor instrumentation by default.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 13:50:35 PDT 2017


morehouse added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:854
                                      HelpText<"Enable use-after-destroy detection in MemorySanitizer">;
+def fno_sanitize_memory_use_after_dtor : Flag<["-"], "fno-sanitize-memory-use-after-dtor">,
+                                     Group<f_clang_Group>,
----------------
vitalybuka wrote:
> I'd recommend to split patch in two:
> 1. Add no-sanitize with tests
> 2. Flip default
Can do.


================
Comment at: clang/test/Driver/fsanitize.c:175
 
-// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-use-after-dtor -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-USE-AFTER-DTOR
-// CHECK-MSAN-USE-AFTER-DTOR: -cc1{{.*}}-fsanitize-memory-use-after-dtor
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-use-after-dtor %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-DTOR
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-use-after-dtor -fsanitize-memory-use-after-dtor %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-DTOR
----------------
vitalybuka wrote:
> Somewhere we need to have test that default is ON or OFF.
> Maybe here?
Line 177 tests that default is ON.


================
Comment at: compiler-rt/test/msan/use-after-dtor.cc:13
 
 #include <sanitizer/msan_interface.h>
 #include <assert.h>
----------------
vitalybuka wrote:
> Probably we need one test which check that we stop detecting bugs with 
> -fno-sanitize-memory-track-origins. Maybe this one or in separate file.
Do you mean `-fno-sanitize-memory-use-after-dtor`?  See `dtor-member.cc` test.


https://reviews.llvm.org/D37860





More information about the llvm-commits mailing list