[PATCH] D28201: Provide default implementations for sanitizer interface functions
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 6 16:42:12 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL291313: Provide default implementations for sanitizer interface functions (authored by fjricci).
Changed prior to commit:
https://reviews.llvm.org/D28201?vs=82772&id=83461#toc
Repository:
rL LLVM
https://reviews.llvm.org/D28201
Files:
compiler-rt/trunk/lib/lsan/lsan_allocator.cc
compiler-rt/trunk/lib/lsan/lsan_common.cc
Index: compiler-rt/trunk/lib/lsan/lsan_allocator.cc
===================================================================
--- compiler-rt/trunk/lib/lsan/lsan_allocator.cc
+++ compiler-rt/trunk/lib/lsan/lsan_allocator.cc
@@ -258,4 +258,17 @@
uptr __sanitizer_get_allocated_size(const void *p) {
return GetMallocUsableSize(p);
}
+
+#if !SANITIZER_SUPPORTS_WEAK_HOOKS
+// Provide default (no-op) implementation of malloc hooks.
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
+void __sanitizer_malloc_hook(void *ptr, uptr size) {
+ (void)ptr;
+ (void)size;
+}
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
+void __sanitizer_free_hook(void *ptr) {
+ (void)ptr;
+}
+#endif
} // extern "C"
Index: compiler-rt/trunk/lib/lsan/lsan_common.cc
===================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cc
+++ compiler-rt/trunk/lib/lsan/lsan_common.cc
@@ -758,5 +758,10 @@
int __lsan_is_turned_off() {
return 0;
}
+
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
+const char *__lsan_default_suppressions() {
+ return "";
+}
#endif
} // extern "C"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28201.83461.patch
Type: text/x-patch
Size: 1130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170107/c805535f/attachment.bin>
More information about the llvm-commits
mailing list