Skip to content

Commit 19357b4

Browse files
committed
[NFCI][sanitizer] Return false on failure from Symbolizer
Looke like a typo intoduced 7a36e61.
1 parent d6b1b99 commit 19357b4

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

compiler-rt/lib/asan/asan_globals.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,9 @@ static void ReportGlobal(const Global &g, const char *prefix) {
8787
g.module_name, g.has_dynamic_init, (void *)g.odr_indicator);
8888

8989
DataInfo info;
90-
Symbolizer::GetOrInit()->SymbolizeData(g.beg, &info);
91-
if (info.line != 0) {
90+
if (Symbolizer::GetOrInit()->SymbolizeData(g.beg, &info) && info.line != 0) {
9291
Report(" location: name=%s, %d\n", info.file, static_cast<int>(info.line));
93-
}
94-
else if (g.gcc_location != 0) {
92+
} else if (g.gcc_location != 0) {
9593
// Fallback to Global::gcc_location
9694
Report(" location: name=%s, %d\n", g.gcc_location->filename, g.gcc_location->line_no);
9795
}
@@ -301,9 +299,7 @@ void PrintGlobalNameIfASCII(InternalScopedString *str, const __asan_global &g) {
301299

302300
void PrintGlobalLocation(InternalScopedString *str, const __asan_global &g) {
303301
DataInfo info;
304-
Symbolizer::GetOrInit()->SymbolizeData(g.beg, &info);
305-
306-
if (info.line != 0) {
302+
if (Symbolizer::GetOrInit()->SymbolizeData(g.beg, &info) && info.line != 0) {
307303
str->AppendF("%s:%d", info.file, static_cast<int>(info.line));
308304
} else if (g.gcc_location != 0) {
309305
// Fallback to Global::gcc_location

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ bool Symbolizer::SymbolizeData(uptr addr, DataInfo *info) {
117117
return true;
118118
}
119119
}
120-
return true;
120+
return false;
121121
}
122122

123123
bool Symbolizer::SymbolizeFrame(uptr addr, FrameInfo *info) {
@@ -133,7 +133,7 @@ bool Symbolizer::SymbolizeFrame(uptr addr, FrameInfo *info) {
133133
return true;
134134
}
135135
}
136-
return true;
136+
return false;
137137
}
138138

139139
bool Symbolizer::GetModuleNameAndOffsetForPC(uptr pc, const char **module_name,

0 commit comments

Comments
 (0)