[PATCH] [lsan] Add __lsan_disable() and __lsan_enable().

Kostya Serebryany kcc at google.com
Mon Jun 3 03:38:05 PDT 2013



================
Comment at: lib/lsan/lit_tests/TestCases/disabler.cc:4
@@ +3,3 @@
+// RUN: %clangxx_lsan -I %p/../../../../include %s -o %t
+// RUN: LSAN_OPTIONS=$LSAN_BASE %t 2>&1 | FileCheck %s
+
----------------
again, I don't like tests that don't run with default options

================
Comment at: lib/lsan/lit_tests/TestCases/disabler.cc:18
@@ +17,3 @@
+  *reinterpret_cast<void **>(p) = malloc(666);
+  void *q = malloc(1337);
+  return 0;
----------------
this is risky. the compiler may nuke this expression, potentially even at O0. 
Hide this from the compiler, e.g. using the break_optimization trick from (asan/lit_tests/stack-oob-frames.cc,CPP)


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

BRANCH
  feat/lsan/suppression-hooks

ARCANIST PROJECT
  compiler-rt



More information about the llvm-commits mailing list