[compiler-rt] c55e5d4 - [sanitizer] Don't ignore Symbolizer errors (#67466)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 26 13:16:46 PDT 2023
Author: Vitaly Buka
Date: 2023-09-26T13:16:42-07:00
New Revision: c55e5d4b18a34e9698314426d6e5077ee7e15025
URL: https://github.com/llvm/llvm-project/commit/c55e5d4b18a34e9698314426d6e5077ee7e15025
DIFF: https://github.com/llvm/llvm-project/commit/c55e5d4b18a34e9698314426d6e5077ee7e15025.diff
LOG: [sanitizer] Don't ignore Symbolizer errors (#67466)
I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.
Added:
Modified:
compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp b/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
index 0aa7368f5ea42eb..ac27c0e25715f29 100644
--- a/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
+++ b/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
@@ -76,13 +76,16 @@ bool __sanitizer_symbolize_code(const char *ModuleName, uint64_t ModuleOffset,
auto ResOrErr = getDefaultSymbolizer()->symbolizeInlinedCode(
ModuleName,
{ModuleOffset, llvm::object::SectionedAddress::UndefSection});
- Printer->print(Request,
- ResOrErr ? ResOrErr.get() : llvm::DIInliningInfo());
+ if (!ResOrErr)
+ return false;
+ Printer->print(Request, ResOrErr.get());
} else {
auto ResOrErr = getDefaultSymbolizer()->symbolizeCode(
ModuleName,
{ModuleOffset, llvm::object::SectionedAddress::UndefSection});
- Printer->print(Request, ResOrErr ? ResOrErr.get() : llvm::DILineInfo());
+ if (!ResOrErr)
+ return false;
+ Printer->print(Request, ResOrErr.get());
}
}
return __sanitizer::internal_snprintf(Buffer, MaxLength, "%s",
@@ -104,7 +107,9 @@ bool __sanitizer_symbolize_data(const char *ModuleName, uint64_t ModuleOffset,
auto ResOrErr = getDefaultSymbolizer()->symbolizeData(
ModuleName,
{ModuleOffset, llvm::object::SectionedAddress::UndefSection});
- Printer->print(Request, ResOrErr ? ResOrErr.get() : llvm::DIGlobal());
+ if (!ResOrErr)
+ return false;
+ Printer->print(Request, ResOrErr.get());
}
return __sanitizer::internal_snprintf(Buffer, MaxLength, "%s",
Result.c_str()) < MaxLength;
More information about the llvm-commits
mailing list