[compiler-rt] [sanitizer] Don't ignore Symbolizer errors (PR #67466)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 26 10:46:02 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
<details>
<summary>Changes</summary>
I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.
---
Full diff: https://github.com/llvm/llvm-project/pull/67466.diff
1 Files Affected:
- (modified) compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp (+9-4)
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp b/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
index f6dac78337068b5..7ae4c159dfc7c55 100644
--- a/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
+++ b/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
@@ -77,13 +77,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());
+ Printer->print(Request, ResOrErr.get());
+ if (!ResOrErr)
+ return false;
} 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",
@@ -105,7 +108,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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/67466
More information about the llvm-commits
mailing list