[PATCH] [msan] -fsanitize-memory-track-origins=[level] flag and docs.

Evgeniy Stepanov eugenis at google.com
Thu Mar 20 06:25:06 PDT 2014



================
Comment at: lib/Driver/SanitizerArgs.cpp:172
@@ +171,3 @@
+      if (S.getAsInteger(0, MsanTrackOrigins) || MsanTrackOrigins < 0 ||
+          MsanTrackOrigins > 2)
+        D.Diag(diag::err_drv_invalid_value)
----------------
Alexey Samsonov wrote:
> Use {} here
done

================
Comment at: lib/Driver/SanitizerArgs.cpp:166
@@ -164,2 +165,3 @@
 
   // Parse -f(no-)sanitize-memory-track-origins options.
+  if (NeedsMsan) {
----------------
Alexey Samsonov wrote:
> Fix a comment
done

================
Comment at: test/Driver/fsanitize.c:78
@@ -77,3 +77,3 @@
 // RUN: %clang -target x86_64-linux-gnu -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-TRACK-ORIGINS
-// CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins'
+// CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins=1'
 
----------------
Alexey Samsonov wrote:
> Evgeniy Stepanov wrote:
> > Alexey Samsonov wrote:
> > > Evgeniy Stepanov wrote:
> > > > Alexey Samsonov wrote:
> > > > > This is confusing. We should try to print the flag the user has provided in command line.
> > > > That's how this Alias thing works...
> > > > We can stop using it, of course, and check all 3 flags manually.
> > > If we can silently drop support for -fno-sanitize-memory-track-origins, I think it's fine to check two flags manually.
> > There must be an -fno- option for every -f option.
> > 
> What a pity. Can we print a deprecated message for these flags then? :)
> We do so for flags like -f(no-)address-sanitizer. Which reminds me we should probably delete them for good! :)
fixed

================
Comment at: docs/MemorySanitizer.rst:153
@@ +152,3 @@
+    % ./a.out 2>log
+    % projects/compiler-rt/lib/asan/scripts/asan_symbolize.py / < log | c++filt
+    WARNING: MemorySanitizer: use-of-uninitialized-value
----------------
Alexey Samsonov wrote:
> Can you please get rid of asan_symbolize.py in MSan docs? Use either MSAN_SYMBOLIZER_PATH, or note that it's enough to have llvm-symbolizer in your PATH.
done


http://llvm-reviews.chandlerc.com/D3118



More information about the cfe-commits mailing list