summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorgraydon <graydon>2005-10-05 00:43:14 +0000
committergraydon <graydon>2005-10-05 00:43:14 +0000
commite8fbc5e8b71db38b83a215498ab34936689c3175 (patch)
tree3042648c42cc4149e0c46995a8e6268948ee91a3 /tapsets.cxx
parent7fac3a3d774152d048f407c101d0d587ee0b93cc (diff)
downloadsystemtap-steved-e8fbc5e8b71db38b83a215498ab34936689c3175.tar.gz
systemtap-steved-e8fbc5e8b71db38b83a215498ab34936689c3175.tar.xz
systemtap-steved-e8fbc5e8b71db38b83a215498ab34936689c3175.zip
2005-10-04 Graydon Hoare <graydon@redhat.com>
PR 1131. * tapsets.cxx (target_variable_flavour_calculating_visitor::visit_target_symbol) (var_expanding_copy_visitor::visit_target_symbol): Require guru mode for writing to target vars. * testsuite/buildok/twenty.stp: Test writing to target vars.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 311c237d..5a7a0726 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1583,6 +1583,9 @@ target_variable_flavour_calculating_visitor::visit_target_symbol (target_symbol
try
{
bool lvalue = is_active_lvalue(e);
+ if (lvalue && !q.sess.guru_mode)
+ throw semantic_error("Writing to target variable outside of guru mode", e->tok);
+
flavour += lvalue ? 'w' : 'r';
exp_type ty;
string expr = q.dw.literal_stmt_for_local(scope_die,
@@ -2214,6 +2217,10 @@ var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
embeddedcode *ec = new embeddedcode;
ec->tok = e->tok;
bool lvalue = is_active_lvalue(e);
+
+ if (lvalue && !q.sess.guru_mode)
+ throw semantic_error("Illegal target variable access", e->tok);
+
string fname = (string(lvalue ? "set" : "get")
+ "_" + e->base_name.substr(1)
+ "_" + lex_cast<string>(tick++));