diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tapsets.cxx | 4 |
2 files changed, 10 insertions, 1 deletions
@@ -1,6 +1,13 @@ 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. + +2007-09-14 David Smith <dsmith@redhat.com> + + PR 1154 * tapsets.cxx (procfs_derived_probe_group::emit_module_init): Fixed problem where if only one type (read/write) of procfs probe was defined, the generated code wouldn't compile. 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; |