From: dsmith Date: Wed, 16 Jan 2008 17:05:50 +0000 (+0000) Subject: 2008-01-16 David Smith X-Git-Tag: release-0.6.2~134 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=6f93ef37f7d97e3cf8f91b94df25adae7a510bfb;p=systemtap.git 2008-01-16 David Smith PR 5608. * tapsets.cxx (visit_target_symbol): Print an error when trying to use a marker argument as an array or structure. --- diff --git a/ChangeLog b/ChangeLog index 2aadaaf94..9f9cbf044 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-16 David Smith + + PR 5608. + * tapsets.cxx (visit_target_symbol): Print an error when trying to + use a marker argument as an array or structure. + 2008-01-16 Eugene Teo * stapfuncs.5.in: Document signal.stp tapset functions. diff --git a/tapsets.cxx b/tapsets.cxx index ebc07ba3b..4bb467862 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -5044,6 +5044,24 @@ mark_var_expanding_copy_visitor::visit_target_symbol (target_symbol* e) if (is_active_lvalue (e)) throw semantic_error("write to marker parameter not permitted", e->tok); + if (e->components.size() > 0) + { + switch (e->components[0].first) + { + case target_symbol::comp_literal_array_index: + throw semantic_error("marker argument may not be used as array", + e->tok); + break; + case target_symbol::comp_struct_member: + throw semantic_error("marker argument may not be used as a structure", + e->tok); + break; + default: + throw semantic_error ("invalid marker argument use", e->tok); + break; + } + } + // Remember that we've seen a target variable. target_symbol_seen = true; @@ -5100,7 +5118,7 @@ mark_derived_probe::mark_derived_probe (systemtap_session &s, this->locations.push_back (pp); if (cond) - add_condition (cond); + add_condition (cond); insert_condition_statement (); // expand the signature string