[compiler-rt] r205192 - [msan] Remove an extra top frame from track-origins=2 reports.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Mon Mar 31 07:18:55 PDT 2014
Author: eugenis
Date: Mon Mar 31 09:18:55 2014
New Revision: 205192
URL: http://llvm.org/viewvc/llvm-project?rev=205192&view=rev
Log:
[msan] Remove an extra top frame from track-origins=2 reports.
Modified:
compiler-rt/trunk/lib/msan/msan.cc
compiler-rt/trunk/lib/msan/msan.h
compiler-rt/trunk/test/msan/chained_origin.cc
compiler-rt/trunk/test/msan/chained_origin_memcpy.cc
Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=205192&r1=205191&r2=205192&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Mon Mar 31 09:18:55 2014
@@ -484,7 +484,9 @@ void __msan_set_alloca_origin4(void *a,
}
u32 __msan_chain_origin(u32 id) {
- GET_STORE_STACK_TRACE;
+ GET_CALLER_PC_BP_SP;
+ (void)sp;
+ GET_STORE_STACK_TRACE_PC_BP(pc, bp);
return ChainOrigin(id, &stack);
}
Modified: compiler-rt/trunk/lib/msan/msan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.h?rev=205192&r1=205191&r2=205192&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Mon Mar 31 09:18:55 2014
@@ -104,13 +104,15 @@ u32 ChainOrigin(u32 id, StackTrace *stac
StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \
common_flags()->fast_unwind_on_malloc)
-#define GET_STORE_STACK_TRACE \
- StackTrace stack; \
- stack.size = 0; \
- if (__msan_get_track_origins() > 1 && msan_inited) \
- GetStackTrace(&stack, common_flags()->malloc_context_size, \
- StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \
- common_flags()->fast_unwind_on_malloc)
+#define GET_STORE_STACK_TRACE_PC_BP(pc, bp) \
+ StackTrace stack; \
+ stack.size = 0; \
+ if (__msan_get_track_origins() > 1 && msan_inited) \
+ GetStackTrace(&stack, common_flags()->malloc_context_size, pc, bp, \
+ common_flags()->fast_unwind_on_malloc)
+
+#define GET_STORE_STACK_TRACE \
+ GET_STORE_STACK_TRACE_PC_BP(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME())
class ScopedThreadLocalStateBackup {
public:
Modified: compiler-rt/trunk/test/msan/chained_origin.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/chained_origin.cc?rev=205192&r1=205191&r2=205192&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/chained_origin.cc (original)
+++ compiler-rt/trunk/test/msan/chained_origin.cc Mon Mar 31 09:18:55 2014
@@ -41,13 +41,13 @@ int main(int argc, char *argv[]) {
// CHECK: {{#0 .* in main.*chained_origin.cc:37}}
// CHECK: Uninitialized value was stored to memory at
-// CHECK: {{#.* in fn_h.*chained_origin.cc:25}}
-// CHECK: {{#.* in main.*chained_origin.cc:36}}
+// CHECK: {{#0 .* in fn_h.*chained_origin.cc:25}}
+// CHECK: {{#1 .* in main.*chained_origin.cc:36}}
// CHECK: Uninitialized value was stored to memory at
-// CHECK: {{#.* in fn_g.*chained_origin.cc:15}}
-// CHECK: {{#.* in fn_f.*chained_origin.cc:20}}
-// CHECK: {{#.* in main.*chained_origin.cc:35}}
+// CHECK: {{#0 .* in fn_g.*chained_origin.cc:15}}
+// CHECK: {{#1 .* in fn_f.*chained_origin.cc:20}}
+// CHECK: {{#2 .* in main.*chained_origin.cc:35}}
// CHECK-STACK: Uninitialized value was created by an allocation of 'z' in the stack frame of function 'main'
// CHECK-STACK: {{#0 .* in main.*chained_origin.cc:28}}
Modified: compiler-rt/trunk/test/msan/chained_origin_memcpy.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/chained_origin_memcpy.cc?rev=205192&r1=205191&r2=205192&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/chained_origin_memcpy.cc (original)
+++ compiler-rt/trunk/test/msan/chained_origin_memcpy.cc Mon Mar 31 09:18:55 2014
@@ -40,11 +40,11 @@ int main(int argc, char *argv[]) {
// CHECK: {{#0 .* in main .*chained_origin_memcpy.cc:36}}
// CHECK: Uninitialized value was stored to memory at
-// CHECK: {{#.* in fn_h.*chained_origin_memcpy.cc:28}}
+// CHECK: {{#1 .* in fn_h.*chained_origin_memcpy.cc:28}}
// CHECK: Uninitialized value was stored to memory at
-// CHECK: {{#.* in fn_g.*chained_origin_memcpy.cc:18}}
-// CHECK: {{#.* in fn_f.*chained_origin_memcpy.cc:23}}
+// CHECK: {{#0 .* in fn_g.*chained_origin_memcpy.cc:18}}
+// CHECK: {{#1 .* in fn_f.*chained_origin_memcpy.cc:23}}
// 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'
More information about the llvm-commits
mailing list