From: Justin Seyster Date: Mon, 7 Feb 2011 22:29:16 +0000 (-0500) Subject: Added type requirement for tracecut params. X-Git-Tag: release-v1.1~9^2~29 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=b00351e389fdeffe2d8a716b29c2337e270bf697;p=interaspect.git Added type requirement for tracecut params. --- 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;;