[PATCH] Moar string interceptors: strstr, strcasestr, strcspn, strpbrk

Kostya Serebryany kcc at google.com
Mon Dec 22 13:00:10 PST 2014


I like the whole thing, the more interceptors the better. 
Statistically, such large changes in interceptors are risky, so please don't commit before the end of holidays in RU, even if you get LGTM before that. 
Please also add a documentation blob to the commit message so that we can later copy-paste it into 
https://code.google.com/p/address-sanitizer/wiki/Flags

glider, please apply this patch and try it on chrome.


================
Comment at: lib/asan/asan_rtl.cc:130
@@ +129,3 @@
+  // The replace_str=false overwrites other replace_str* flags
+  if (!f->replace_str) {
+    cf->replace_strstr = false;
----------------
Is this necessary?
Such things are sometimes unavoidable, but they complicate the code, the understanding and the documentation. 
I'd rather prefer users to add more flags... 


================
Comment at: test/asan/TestCases/atoi_strict.c:3
@@ +2,3 @@
+// RUN: %clang_asan %s -o %t
+// RUN: ASAN_OPTIONS=strict_str=false %run %t 2>&1
+// RUN: ASAN_OPTIONS=strict_str=true not %run %t 2>&1 | FileCheck %s
----------------
also, add a 3-rd run with no flag so that we test the default behaviour.
same for other tests.

http://reviews.llvm.org/D6056

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list