A transform like the one below, works for func_1(&something->field)
when something is a foo_t
but does not catch cases where v is itself a field such as func_1(&something->v->field)
@@
typedef foo_t;
foo_t *v;
@@
- func_1(&v->field)
+ func_2(v)
On the other hand, if I use an expression like this:
@@
expression v;
@@
- func_1(&v->field)
+ func_2(v)
It works, but is too eager and may match cases where the type is not foo_t
, just because some other type has the same field name.
Is there a way to get a match on expressions, but limit the expression type to be foo_t
?