[PATCH] D30384: [asan] Add an interceptor for strtok

Manuel Rigger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 14:36:02 PDT 2017


mrigger added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:500
+INTERCEPTOR(char*, strtok, char *str, const char *delimiters) {
+  void *ctx;
+  COMMON_INTERCEPTOR_ENTER(ctx, strtok, str, delimiters);
----------------
ygribov wrote:
> Bind star to `ctx`?
Sorry, I didn't get this comment. Should I change something in the code?


================
Comment at: test/asan/TestCases/strtok.c:12
+// RUN: %env_asan_opts=intercept_strtok=false:intercept_strlen=false %run %t test4 2>&1
+// RUN: %clang_asan %s -o %t && %env_asan_opts=strict_string_checks=false not %run %t test5 2>&1 | FileCheck %s --check-prefix=CHECK5
+// RUN: %env_asan_opts=intercept_strtok=false:intercept_strlen=false %run %t test5 2>&1
----------------
alekseyshl wrote:
> mrigger wrote:
> > alekseyshl wrote:
> > > And, if we go with one file, please wrap these long lines like this:
> > > 
> > > // RUN: ... | \
> > > // RUN:     FileCheck ...
> > The other test cases, from which I copied this pattern, are all written in one line. Should I still break the existing "convention"?
> Style evolves. This is not critical, especially with your last change, lines are shorter and easier to parse, but still, I prefer to keep all lines under 80 chars. If it is not too big of a problem, I'd appreciate breaking those exceeding 80 chars at FileCheck, as I suggested, and please indent FileCheck:
> 
> `RUN:    FileCheck ...`
Done. Note that I also removed `intercept_strtok=false` since it is not necessary in the current implementation.


https://reviews.llvm.org/D30384





More information about the llvm-commits mailing list