diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:30:29 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:30:29 +0000 |
commit | 7ed46ff7af911da0dd2067734d1408c6986c6657 (patch) | |
tree | d1108ca92e40aa5ffd65528ce61fac03a7539615 /lib/ubsan/ubsan_diag.cc | |
parent | 6a7c51db8449fa948990501e65db4e71bf58e198 (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.cc | 3 |
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); |