Make sure ASan always emits an error summary if it reports an error.

llvm-svn: 193229
This commit is contained in:
Nick Lewycky 2013-10-23 06:19:04 +00:00
parent 84413437ce
commit d27d668342
1 changed files with 2 additions and 4 deletions

View File

@ -550,16 +550,14 @@ class ScopedInErrorReport {
};
static void ReportSummary(const char *error_type, StackTrace *stack) {
if (!stack->size) return;
AddressInfo ai;
if (&getSymbolizer && getSymbolizer()->IsAvailable()) {
AddressInfo ai;
// Currently, we include the first stack frame into the report summary.
// Maybe sometimes we need to choose another frame (e.g. skip memcpy/etc).
uptr pc = StackTrace::GetPreviousInstructionPc(stack->trace[0]);
getSymbolizer()->SymbolizeCode(pc, &ai, 1);
ReportErrorSummary(error_type, ai.file, ai.line, ai.function);
}
// FIXME: do we need to print anything at all if there is no symbolizer?
ReportErrorSummary(error_type, ai.file, ai.line, ai.function);
}
void ReportSIGSEGV(uptr pc, uptr sp, uptr bp, uptr addr) {