diff --git a/compiler-rt/lib/msan/msan_report.cpp b/compiler-rt/lib/msan/msan_report.cpp --- a/compiler-rt/lib/msan/msan_report.cpp +++ b/compiler-rt/lib/msan/msan_report.cpp @@ -36,17 +36,11 @@ static void DescribeStackOrigin(const char *so, uptr pc) { Decorator d; - char *s = internal_strdup(so); - char *sep = internal_strchr(s, '@'); - CHECK(sep); - *sep = '\0'; Printf("%s", d.Origin()); Printf( " %sUninitialized value was created by an allocation of '%s%s%s'" - " in the stack frame of function '%s%s%s'%s\n", - d.Origin(), d.Name(), s, d.Origin(), d.Name(), sep + 1, d.Origin(), - d.Default()); - InternalFree(s); + " in the stack frame%s\n", + d.Origin(), d.Name(), so, d.Origin(), d.Default()); if (pc) { // For some reason function address in LLVM IR is 1 less then the address diff --git a/compiler-rt/test/msan/chained_origin.cpp b/compiler-rt/test/msan/chained_origin.cpp --- a/compiler-rt/test/msan/chained_origin.cpp +++ b/compiler-rt/test/msan/chained_origin.cpp @@ -60,7 +60,7 @@ // CHECK-FULL-STACK: {{#2 .* in main.*chained_origin.cpp:}}[[@LINE-16]] // CHECK-SHORT-STACK: {{#0 .* in fn_g.*chained_origin.cpp:}}[[@LINE-37]] -// CHECK-STACK: Uninitialized value was created by an allocation of 'z' in the stack frame of function 'main' +// CHECK-STACK: Uninitialized value was created by an allocation of 'z' in the stack frame // CHECK-STACK: {{#0 .* in main.*chained_origin.cpp:}}[[@LINE-22]] // CHECK-HEAP: Uninitialized value was created by a heap allocation diff --git a/compiler-rt/test/msan/chained_origin_empty_stack.cpp b/compiler-rt/test/msan/chained_origin_empty_stack.cpp --- a/compiler-rt/test/msan/chained_origin_empty_stack.cpp +++ b/compiler-rt/test/msan/chained_origin_empty_stack.cpp @@ -10,7 +10,7 @@ // CHECK: #0 {{.*}} in fn_g // CHECK-NOT: #1 -// CHECK: Uninitialized value was created by an allocation of 'z' in the stack frame of function 'main' +// CHECK: Uninitialized value was created by an allocation of 'z' in the stack frame // CHECK: #0 {{.*}} in main #include diff --git a/compiler-rt/test/msan/chained_origin_memcpy.cpp b/compiler-rt/test/msan/chained_origin_memcpy.cpp --- a/compiler-rt/test/msan/chained_origin_memcpy.cpp +++ b/compiler-rt/test/msan/chained_origin_memcpy.cpp @@ -57,7 +57,7 @@ // CHECK-FULL-STACK: {{#1 .* in fn_f.*chained_origin_memcpy.cpp:}}[[@LINE-25]] // CHECK-SHORT-STACK: {{#0 .* in fn_g.*chained_origin_memcpy.cpp:}}[[@LINE-31]] -// CHECK-Z1: Uninitialized value was created by an allocation of 'z1' in the stack frame of function 'main' -// CHECK-Z2: Uninitialized value was created by an allocation of 'z2' in the stack frame of function 'main' +// CHECK-Z1: Uninitialized value was created by an allocation of 'z1' in the stack frame +// CHECK-Z2: Uninitialized value was created by an allocation of 'z2' in the stack frame // CHECK-Z1: {{#0 .* in main.*chained_origin_memcpy.cpp:}}[[@LINE-21]] // CHECK-Z2: {{#0 .* in main.*chained_origin_memcpy.cpp:}}[[@LINE-21]] diff --git a/compiler-rt/test/msan/chained_origin_memmove.cpp b/compiler-rt/test/msan/chained_origin_memmove.cpp --- a/compiler-rt/test/msan/chained_origin_memmove.cpp +++ b/compiler-rt/test/msan/chained_origin_memmove.cpp @@ -52,7 +52,7 @@ // CHECK-FULL-STACK: {{#1 .* in fn_f.*chained_origin_memmove.cpp:}}[[@LINE-24]] // CHECK-SHORT-STACK: {{#0 .* in fn_g.*chained_origin_memmove.cpp:}}[[@LINE-29]] -// CHECK-Z1: Uninitialized value was created by an allocation of 'z1' in the stack frame of function 'main' -// CHECK-Z2: Uninitialized value was created by an allocation of 'z2' in the stack frame of function 'main' +// CHECK-Z1: Uninitialized value was created by an allocation of 'z1' in the stack frame +// CHECK-Z2: Uninitialized value was created by an allocation of 'z2' in the stack frame // CHECK-Z1: {{#0 .* in main.*chained_origin_memmove.cpp:}}[[@LINE-21]] // CHECK-Z2: {{#0 .* in main.*chained_origin_memmove.cpp:}}[[@LINE-21]] diff --git a/compiler-rt/test/msan/msan_print_shadow.cpp b/compiler-rt/test/msan/msan_print_shadow.cpp --- a/compiler-rt/test/msan/msan_print_shadow.cpp +++ b/compiler-rt/test/msan/msan_print_shadow.cpp @@ -106,7 +106,7 @@ // CHECK-ORIGINS: Origin C (origin_id {{.*}}): // CHECK-ORIGINS-2: Uninitialized value was stored to memory at // CHECK-ORIGINS-2: #0 {{.*}} in main{{.*}}msan_print_shadow.cpp:48 -// CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' +// CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame // CHECK-ORIGINS: #0 {{.*}} in main{{.*}}msan_print_shadow.cpp:13 // CHECK-ORIGINS: Origin D (origin_id {{.*}}): diff --git a/compiler-rt/test/msan/report-demangling.cpp b/compiler-rt/test/msan/report-demangling.cpp --- a/compiler-rt/test/msan/report-demangling.cpp +++ b/compiler-rt/test/msan/report-demangling.cpp @@ -14,6 +14,6 @@ int main(int argc, char **argv) { return f(); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value - // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function '_Z1fv' + // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame // CHECK: #0 {{.*}} in f{{.*}} {{.*}}report-demangling.cpp:[[@LINE-9]] } diff --git a/compiler-rt/test/msan/select_origin.cpp b/compiler-rt/test/msan/select_origin.cpp --- a/compiler-rt/test/msan/select_origin.cpp +++ b/compiler-rt/test/msan/select_origin.cpp @@ -17,6 +17,6 @@ int *volatile px = &x; int y = 43; int *p = max_by_ptr(px, &y); - // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' + // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame return *p; } diff --git a/compiler-rt/test/msan/stack-origin.cpp b/compiler-rt/test/msan/stack-origin.cpp --- a/compiler-rt/test/msan/stack-origin.cpp +++ b/compiler-rt/test/msan/stack-origin.cpp @@ -24,7 +24,7 @@ // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*stack-origin.cpp:}}[[@LINE-2]] - // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' + // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame // CHECK-ORIGINS: {{#0 0x.* in main .*stack-origin.cpp:}}[[@LINE-7]] // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*stack-origin.cpp:.* main}} diff --git a/compiler-rt/test/msan/stack-origin2.cpp b/compiler-rt/test/msan/stack-origin2.cpp --- a/compiler-rt/test/msan/stack-origin2.cpp +++ b/compiler-rt/test/msan/stack-origin2.cpp @@ -34,7 +34,7 @@ // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*stack-origin2.cpp:}}[[@LINE-2]] - // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'f' + // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame // CHECK-ORIGINS: {{#0 0x.* in f .*stack-origin2.cpp:}}[[@LINE-11]] // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*stack-origin2.cpp:.* main}} diff --git a/compiler-rt/test/msan/unaligned_read_origin.cpp b/compiler-rt/test/msan/unaligned_read_origin.cpp --- a/compiler-rt/test/msan/unaligned_read_origin.cpp +++ b/compiler-rt/test/msan/unaligned_read_origin.cpp @@ -11,6 +11,6 @@ return __sanitizer_unaligned_load32(p); // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK: {{#0 0x.* in main .*unaligned_read_origin.cpp:}}[[@LINE-2]] - // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' + // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame // CHECK: {{#0 0x.* in main .*unaligned_read_origin.cpp:}}[[@LINE-6]] } diff --git a/compiler-rt/test/msan/vararg.cpp b/compiler-rt/test/msan/vararg.cpp --- a/compiler-rt/test/msan/vararg.cpp +++ b/compiler-rt/test/msan/vararg.cpp @@ -57,4 +57,4 @@ } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value -// CHECK-ORIGIN: Uninitialized value was created by an allocation of 'uninit' in the stack frame of function 'main' +// CHECK-ORIGIN: Uninitialized value was created by an allocation of 'uninit' in the stack frame diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -3875,7 +3875,7 @@ // It will be printed by the run-time if stack-originated UMR is found. // The first 4 bytes of the string are set to '----' and will be replaced // by __msan_va_arg_overflow_size_tls at the first call. - StackDescription << "----" << I.getName() << "@" << F.getName(); + StackDescription << "----" << I.getName(); return createPrivateNonConstGlobalForString(*F.getParent(), StackDescription.str()); }