summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_diag.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-04-05 07:30:29 +0000
committerAlexey Samsonov <samsonov@google.com>2013-04-05 07:30:29 +0000
commit7ed46ff7af911da0dd2067734d1408c6986c6657 (patch)
treed1108ca92e40aa5ffd65528ce61fac03a7539615 /lib/ubsan/ubsan_diag.cc
parent6a7c51db8449fa948990501e65db4e71bf58e198 (diff)
[Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan/ubsan_diag.cc')
-rw-r--r--lib/ubsan/ubsan_diag.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ubsan/ubsan_diag.cc b/lib/ubsan/ubsan_diag.cc
index 0727ed721..3f9276146 100644
--- a/lib/ubsan/ubsan_diag.cc
+++ b/lib/ubsan/ubsan_diag.cc
@@ -31,7 +31,7 @@ Location __ubsan::getCallerLocation(uptr CallerLoc) {
if (!SymbolizeCode(Loc, &Info, 1) || !Info.module || !*Info.module)
return Location(Loc);
- if (!Info.function)
+ if (!Info.file)
return ModuleLocation(Info.module, Info.module_offset);
return SourceLocation(Info.file, Info.line, Info.column);
@@ -237,6 +237,7 @@ static void renderMemorySnippet(const __sanitizer::AnsiColorDecorator &Decor,
Diag::~Diag() {
__sanitizer::AnsiColorDecorator Decor(PrintsToTty());
+ SpinMutexLock l(&CommonSanitizerReportMutex);
Printf(Decor.Bold());
renderLocation(Loc);