summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx4
1 files changed, 3 insertions, 1 deletions
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); }
}
}