[compiler-rt] [sanitizer] Don't ignore Symbolizer errors (PR #67466)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 26 10:44:56 PDT 2023
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/67466
I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.
>From a0370ed7b11e17607a9a69a8ffde1c5624a67579 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Tue, 26 Sep 2023 10:43:01 -0700
Subject: [PATCH] [sanitizer] Don't ignore Symbolizer errors
I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.
---
.../symbolizer/sanitizer_symbolize.cpp | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
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;
More information about the llvm-commits
mailing list