From 84680f7eef6d7f0a30213ceb6cc254a230eb5eab Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 28 Nov 2008 10:49:15 -0500 Subject: PR6477: tolerate null token, e.g., from unwindsym warning message --- ChangeLog | 6 ++++++ elaborate.cxx | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2875ed6d..038bf59e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-28 Frank Ch. Eigler + + PR 6477. + * elaborate.cxx (print_error_source, print_warning): Tolerate + NULL token. + 2008-11-27 Frank Ch. Eigler PR 7036 diff --git a/elaborate.cxx b/elaborate.cxx index 0dd80626..84866c35 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1498,6 +1498,8 @@ systemtap_session::print_error_source (std::ostream& message, unsigned line = tok->location.line; unsigned col = tok->location.column; string file_contents; + + assert (tok); if (tok->location.stap_file) file_contents = tok->location.stap_file->file_contents; else @@ -1535,7 +1537,7 @@ systemtap_session::print_warning (const string& message_str, const token* tok) clog << "WARNING: " << message_str; if (tok) { clog << ": "; print_token (clog, tok); } clog << endl; - print_error_source (clog, align_warning, tok); + if (tok) { print_error_source (clog, align_warning, tok); } } } -- cgit