diff options
author | dsmith <dsmith> | 2008-01-17 20:27:41 +0000 |
---|---|---|
committer | dsmith <dsmith> | 2008-01-17 20:27:41 +0000 |
commit | 4ec2f7d0c190ca8564bbbe628838757737180087 (patch) | |
tree | 855b227828b9e5f1e13ba33a0e236fcd3d03950a | |
parent | d64e82b10de444d6bbbec3bcc6f3da65cad55e68 (diff) | |
download | systemtap-steved-4ec2f7d0c190ca8564bbbe628838757737180087.tar.gz systemtap-steved-4ec2f7d0c190ca8564bbbe628838757737180087.tar.xz systemtap-steved-4ec2f7d0c190ca8564bbbe628838757737180087.zip |
2008-01-17 David Smith <dsmith@redhat.com>
* tapsets.cxx
(procfs_var_expanding_copy_visitor::visit_target_symbol): Print an
error when trying to use the procfs target variable '$value' as an
array or structure.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | tapsets.cxx | 19 |
2 files changed, 30 insertions, 2 deletions
@@ -1,8 +1,17 @@ +2008-01-17 David Smith <dsmith@redhat.com> + + * tapsets.cxx + (procfs_var_expanding_copy_visitor::visit_target_symbol): Print an + error when trying to use the procfs target variable '$value' as an + array or structure. + 2008-01-16 David Smith <dsmith@redhat.com> PR 5608. - * tapsets.cxx (visit_target_symbol): Print an error when trying to - use a marker argument as an array or structure. + * tapsets.cxx + (mark_var_expanding_copy_visitor::visit_target_symbol): Print an + error when trying to use a marker argument as an array or + structure. 2008-01-16 Eugene Teo <eteo@redhat.com> diff --git a/tapsets.cxx b/tapsets.cxx index b92344ba..89819d6e 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4800,6 +4800,25 @@ procfs_var_expanding_copy_visitor::visit_target_symbol (target_symbol* e) throw semantic_error ("invalid target symbol for procfs probe, $value expected", e->tok); + if (e->components.size() > 0) + { + switch (e->components[0].first) + { + case target_symbol::comp_literal_array_index: + throw semantic_error("procfs target variable '$value' may not be used as array", + e->tok); + break; + case target_symbol::comp_struct_member: + throw semantic_error("procfs target variable '$value' may not be used as a structure", + e->tok); + break; + default: + throw semantic_error ("invalid use of procfs target variable '$value'", + e->tok); + break; + } + } + bool lvalue = is_active_lvalue(e); if (write_probe && lvalue) throw semantic_error("procfs $value variable is read-only in a procfs write probe", e->tok); |