[PATCH] Sanitize printf functions

Kostya Serebryany kcc at google.com
Thu Jan 9 00:43:01 PST 2014



================
Comment at: sanitizer_common/sanitizer_flags.h:60
@@ -59,1 +59,3 @@
+  // Check printf arguments.
+  bool check_printf;
 };
----------------
I actually changed my mind. 
Please make if false by default for now. 
After this patch is committed we'll test it a bit more before enabling by default. 

================
Comment at: asan/lit_tests/TestCases/printf-2.c:2
@@ +1,3 @@
+// RUN: %clang_asan -O2 %s -o %t
+// RUN: not %t 2>&1 | FileCheck %s
+
----------------
please make these tests run in 3 modes:
  ASAN_OPTIONS=check_printf=0
  ASAN_OPTIONS=check_printf=1
  ASAN_OPTIONS=""

we need to test that the flag affects the behavior and that it's default value is what we expect it to be.

(use FileCheck --check-prefix=CHECK-ON and --check-prefix=CHECK-OFF)


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



More information about the llvm-commits mailing list