diff options
author | dsmith <dsmith> | 2007-09-14 16:46:00 +0000 |
---|---|---|
committer | dsmith <dsmith> | 2007-09-14 16:46:00 +0000 |
commit | cf8dc3c7fc65aa91a5a94906682af3acc9dca98b (patch) | |
tree | e36a432e8669344e7d27e0245d790acb8c2e7ef3 /tapsets.cxx | |
parent | b38d9a7d9219f6bc2ea04219d87575ab127bb32e (diff) | |
download | systemtap-steved-cf8dc3c7fc65aa91a5a94906682af3acc9dca98b.tar.gz systemtap-steved-cf8dc3c7fc65aa91a5a94906682af3acc9dca98b.tar.xz systemtap-steved-cf8dc3c7fc65aa91a5a94906682af3acc9dca98b.zip |
2007-09-14 David Smith <dsmith@redhat.com>
PR 1154
* tapsets.cxx
(procfs_var_expanding_copy_visitor::visit_target_symbol):
Disallows reading from $value in a procfs read probe.
(procfs_derived_probe_group::emit_module_init): Updated previous
fix.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 38067a7b..042612da 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4707,7 +4707,7 @@ procfs_derived_probe_group::emit_module_init (systemtap_session& s) if (has_write_probes) { - s.op->newline(-1) << "if (spp->write_pp)"; + s.op->newline() << "if (spp->write_pp)"; s.op->newline(1) << "_stp_procfs_files[i]->write_proc = &_stp_procfs_write;"; s.op->newline(-1) << "else"; s.op->newline(1) << "_stp_procfs_files[i]->write_proc = NULL;"; @@ -4743,6 +4743,8 @@ procfs_var_expanding_copy_visitor::visit_target_symbol (target_symbol* e) 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); + else if (! write_probe && ! lvalue) + throw semantic_error("procfs $value variable cannot be read in a procfs read probe", e->tok); // Remember that we've seen a target variable. target_symbol_seen = true; |