summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-03-06 11:41:49 -0800
committerJosh Stone <jistone@redhat.com>2010-03-06 11:41:49 -0800
commit63ea4244cd378a756017c66085bdf45d4ce95df4 (patch)
tree5527c03574a0e4734809e569884a667f6f1af6e1 /translate.cxx
parent54975cd8f5844cca2cc0a32ab26fd2b546a81984 (diff)
downloadsystemtap-steved-63ea4244cd378a756017c66085bdf45d4ce95df4.tar.gz
systemtap-steved-63ea4244cd378a756017c66085bdf45d4ce95df4.tar.xz
systemtap-steved-63ea4244cd378a756017c66085bdf45d4ce95df4.zip
PR11352: Assign tokens to all SDT-synthesized elements
* tapsets.cxx (sdt_query::convert_probe): Fix a few missing tokens. (sdt_var_expanding_visitor::visit_target_symbol): Ditto. * translate.cxx (c_unparser::record_actions): Add a defensive check, which perhaps someday can be an assertion instead.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/translate.cxx b/translate.cxx
index 9750254d..cb4988ee 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -2329,7 +2329,12 @@ c_unparser::record_actions (unsigned actions, const token* tok, bool update)
o->newline() << "c->actionremaining -= " << action_counter << ";";
o->newline() << "if (unlikely (c->actionremaining <= 0)) {";
o->newline(1) << "c->last_error = \"MAXACTION exceeded\";";
- o->newline() << "c->last_stmt = " << lex_cast_qstring(*tok) << ";";
+
+ // XXX it really ought to be illegal for anything to be missing a token,
+ // but until we're sure of that, we need to defend against NULL.
+ if (tok)
+ o->newline() << "c->last_stmt = " << lex_cast_qstring(*tok) << ";";
+
o->newline() << "goto out;";
o->newline(-1) << "}";
action_counter = 0;