[PATCH] Sanitize printf functions

Yury Gribov tetra2005 at gmail.com
Thu Jan 9 00:52:09 PST 2014



================
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
+
----------------
Yury Gribov wrote:
> Kostya Serebryany wrote:
> > 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)
> Ok.
BTW how do you suggest the check_printf=0 case? In my understanding we'll have UB with absolutely unpredictable behavior...


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



More information about the llvm-commits mailing list