diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-11-14 09:54:10 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-11-14 09:54:10 +0000 |
commit | aed8584ec902e6fe67c03f1102feee6a3f1bdd14 (patch) | |
tree | fcd890b46195e775ef7ddcbf98976470c9039a59 | |
parent | bb4697fe8cbe79c517e6f85713f2de6bd804209d (diff) | |
download | compiler-rt-aed8584ec902e6fe67c03f1102feee6a3f1bdd14.tar.gz |
[UBSan] Update UBSan location rendering to match r194686
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194687 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/ubsan/ubsan_diag.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/ubsan/ubsan_diag.cc b/lib/ubsan/ubsan_diag.cc index 158408b7d..fa643658e 100644 --- a/lib/ubsan/ubsan_diag.cc +++ b/lib/ubsan/ubsan_diag.cc @@ -77,27 +77,29 @@ static void PrintHex(UIntMax Val) { } static void renderLocation(Location Loc) { + InternalScopedString LocBuffer(1024); switch (Loc.getKind()) { case Location::LK_Source: { SourceLocation SLoc = Loc.getSourceLocation(); if (SLoc.isInvalid()) - Printf("<unknown>"); + LocBuffer.append("<unknown>"); else - PrintSourceLocation(SLoc.getFilename(), SLoc.getLine(), SLoc.getColumn()); + PrintSourceLocation(&LocBuffer, SLoc.getFilename(), SLoc.getLine(), + SLoc.getColumn()); break; } case Location::LK_Module: - PrintModuleAndOffset(Loc.getModuleLocation().getModuleName(), + PrintModuleAndOffset(&LocBuffer, Loc.getModuleLocation().getModuleName(), Loc.getModuleLocation().getOffset()); break; case Location::LK_Memory: - Printf("%p", Loc.getMemoryLocation()); + LocBuffer.append("%p", Loc.getMemoryLocation()); break; case Location::LK_Null: - Printf("<unknown>"); + LocBuffer.append("<unknown>"); break; } - Printf(":"); + Printf("%s:", LocBuffer.data()); } static void renderText(const char *Message, const Diag::Arg *Args) { |