]> sourceware.org Git - systemtap.git/commitdiff
2008-01-16 David Smith <dsmith@redhat.com>
authordsmith <dsmith>
Wed, 16 Jan 2008 17:05:50 +0000 (17:05 +0000)
committerdsmith <dsmith>
Wed, 16 Jan 2008 17:05:50 +0000 (17:05 +0000)
        PR 5608.
        * tapsets.cxx (visit_target_symbol): Print an error when trying to
        use a marker argument as an array or structure.

ChangeLog
tapsets.cxx

index 2aadaaf94a82d8703a40fd0b4fb30e16acfc0777..9f9cbf04488bf39ac327a1814f0508cefb41203b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2008-01-16  Eugene Teo  <eteo@redhat.com>
 
        * stapfuncs.5.in: Document signal.stp tapset functions.
index ebc07ba3bd900bcf33a98cd25500c7bc26eb8d6a..4bb467862837a58d0fb091874ef6f0f81a7f04a8 100644 (file)
@@ -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
This page took 0.036649 seconds and 5 git commands to generate.