Added type requirement for tracecut params.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Mon, 7 Feb 2011 22:29:16 +0000 (17:29 -0500)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Mon, 7 Feb 2011 22:29:16 +0000 (17:29 -0500)
src/tracecut.c

index b4985dc84bcc168deb9e8f874b108cd7dd449e0e..3ee84b1aaad9b69585f427278f030c3945880834 100644 (file)
@@ -119,6 +119,10 @@ lookup_param (struct tc_tracecut *tc, const char *name)
  * specify which runtime object it applies to.  Use of of tracecut's
  * <i>bind</i> functions to bind a tracecut param to an actual runtime
  * value captured by InterAspect.
+ *
+ * All params must have an #aop_type that matches pointer types only
+ * (i.e., aop_is_pointer_type() returns true).
+ *
  * \param tc The tracecut to add a param to.
  * \param name The name used to reference this param.
  * \param type They type of this param.
@@ -127,6 +131,8 @@ lookup_param (struct tc_tracecut *tc, const char *name)
  *      started;
  * - #TC_DUPLICATE, if there already exists a param with the
  *    specified name;
+ * - #TC_INVAL, if aop_is_pointer_type() is false for the specified
+ *    type;
  * - #TC_NOMEM, if memory runs out.
  */
 enum tc_error
@@ -135,6 +141,9 @@ tc_add_param (struct tc_tracecut *tc, const char *name,
 {
   struct tc_param *param = NULL;
 
+  if (!aop_is_pointer_type (type))
+    return TC_INVAL;
+
   if (lookup_param (tc, name) != NULL)
     return TC_DUPLICATE;;