summaryrefslogtreecommitdiff
path: root/lib/msan/msan_report.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-10-26 03:35:14 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-10-26 03:35:14 +0000
commit4c25703803a2bf100987e0905314eebd2af1c5c7 (patch)
tree13f177d45ee7a7a05958a818c149f41615d257fd /lib/msan/msan_report.cc
parent259b4571c582b9c6852b2d18b5583f25bc6582f6 (diff)
[Sanitizer] Make StackTrace a lightweight reference to array of PCs, and
introduce a BufferedStackTrace class, which owns this array. Summary: This change splits __sanitizer::StackTrace class into a lightweight __sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace, which owns it. This would allow us to simplify the interface of StackDepot, and eventually merge __sanitizer::StackTrace with __tsan::StackTrace. Test Plan: regression test suite. Reviewers: kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5985 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan_report.cc')
-rw-r--r--lib/msan/msan_report.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/msan/msan_report.cc b/lib/msan/msan_report.cc
index 28dce8526..0f306375d 100644
--- a/lib/msan/msan_report.cc
+++ b/lib/msan/msan_report.cc
@@ -54,7 +54,7 @@ static void DescribeStackOrigin(const char *so, uptr pc) {
// For some reason function address in LLVM IR is 1 less then the address
// of the first instruction.
pc += 1;
- StackTrace::PrintStack(&pc, 1);
+ StackTrace(&pc, 1).Print();
}
}
@@ -77,20 +77,16 @@ static void DescribeOrigin(u32 id) {
DescribeStackOrigin(so, pc);
break;
} else if (prev_o.isHeapRoot()) {
- uptr size = 0;
- const uptr *trace = StackDepotGet(stack_id, &size);
Printf(" %sUninitialized value was created by a heap allocation%s\n",
d.Origin(), d.End());
- StackTrace::PrintStack(trace, size);
+ StackDepotGet(stack_id).Print();
break;
} else {
// chained origin
- uptr size = 0;
- const uptr *trace = StackDepotGet(stack_id, &size);
// FIXME: copied? modified? passed through? observed?
Printf(" %sUninitialized value was stored to memory at%s\n", d.Origin(),
d.End());
- StackTrace::PrintStack(trace, size);
+ StackDepotGet(stack_id).Print();
id = prev_id;
}
}