re-added changes due to svn config setting issues

llvm-svn: 242589
This commit is contained in:
Naomi Musgrave 2015-07-17 23:28:00 +00:00
parent 9e85980658
commit 9a5e3922bf
5 changed files with 18 additions and 1 deletions

View File

@ -92,6 +92,9 @@ extern "C" {
Memory will be marked uninitialized, with origin at the call site. */
void __msan_allocated_memory(const volatile void* data, size_t size);
/* Tell MSan about newly destroyed memory. Mark memory as uninitialized. */
void __sanitizer_dtor_callback(const volatile void* data, size_t size);
/* This function may be optionally provided by user and should return
a string containing Msan runtime options. See msan_flags.h for details. */
const char* __msan_default_options();

View File

@ -511,7 +511,7 @@ void __msan_partial_poison(const void* data, void* shadow, uptr size) {
internal_memcpy((void*)MEM_TO_SHADOW((uptr)data), shadow, size);
}
void __msan_load_unpoisoned(void *src, uptr size, void *dst) {
void __msan_load_unpoisoned(const void *src, uptr size, void *dst) {
internal_memcpy(dst, src, size);
__msan_unpoison(dst, size);
}

View File

@ -24,6 +24,7 @@ MSAN_FLAG(bool, poison_heap_with_zeroes, false, "")
MSAN_FLAG(bool, poison_stack_with_zeroes, false, "")
MSAN_FLAG(bool, poison_in_malloc, true, "")
MSAN_FLAG(bool, poison_in_free, true, "")
MSAN_FLAG(bool, poison_in_dtor, false, "")
MSAN_FLAG(bool, report_umrs, true, "")
MSAN_FLAG(bool, wrap_signals, true, "")
MSAN_FLAG(bool, print_stats, false, "")

View File

@ -1005,6 +1005,14 @@ void __msan_allocated_memory(const void *data, uptr size) {
}
}
void __sanitizer_dtor_callback(const void *data, uptr size) {
GET_MALLOC_STACK_TRACE;
if (flags()->poison_in_dtor) {
stack.tag = STACK_TRACE_TAG_POISON;
PoisonMemory(data, size, &stack);
}
}
INTERCEPTOR(void *, mmap, void *addr, SIZE_T length, int prot, int flags,
int fd, OFF_T offset) {
if (msan_init_is_running)

View File

@ -140,6 +140,11 @@ void __msan_partial_poison(const void* data, void* shadow, uptr size);
SANITIZER_INTERFACE_ATTRIBUTE
void __msan_allocated_memory(const void* data, uptr size);
// Tell MSan about newly destroyed memory. Memory will be marked
// uninitialized.
SANITIZER_INTERFACE_ATTRIBUTE
void __sanitizer_dtor_callback(const void* data, uptr size);
SANITIZER_INTERFACE_ATTRIBUTE
u16 __sanitizer_unaligned_load16(const uu16 *p);