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 --- elaborate.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'elaborate.cxx') 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