From b00351e389fdeffe2d8a716b29c2337e270bf697 Mon Sep 17 00:00:00 2001 From: Justin Seyster Date: Mon, 7 Feb 2011 17:29:16 -0500 Subject: [PATCH] Added type requirement for tracecut params. --- src/tracecut.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tracecut.c b/src/tracecut.c index b4985dc..3ee84b1 100644 --- a/src/tracecut.c +++ b/src/tracecut.c @@ -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 * bind 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;; -- 2.34.1