[PATCH] Tests and interface for LeakSanitizer.
Alexander Potapenko
glider at google.com
Wed Apr 17 02:10:28 PDT 2013
================
Comment at: lib/lsan/tests/lsan_test.cc:95
@@ +94,3 @@
+
+volatile void *data_var = (void*) 1;
+
----------------
Alexey Samsonov wrote:
> I think you can avoid wasting global namespace by anonymous namespaces (here and below)
A single anonymous namespace should be actually enough.
================
Comment at: lib/lsan/tests/lsan_test.cc:389
@@ +388,3 @@
+ void *p = malloc(kSmallAllocSize);
+ internal_memcpy(char_arr + 1, &p, sizeof(uptr));
+ EXPECT_LEAKED(p);
----------------
Alexey Samsonov wrote:
> Curious: why not plain "memcpy"?
Yeah, I think we'd better avoid including too much sanitizer_common headers. Ideally your test should only depend on lsan_interface.h
http://llvm-reviews.chandlerc.com/D677
More information about the llvm-commits
mailing list