On Fri, Aug 18, 2017 at 10:08 AM, Julia Lawall <julia.law...@lip6.fr> wrote:
>
>
> On Fri, 18 Aug 2017, Kees Cook wrote:
>
>> I'd like to have a rule that would match both:
>>
>> function(ptr);
>> ptr->field = 7;
>>
>> and
>>
>> function(&obj);
>> obj.field = 7;
>>
>> to produce:
>>
>> new_function(ptr, 7);
>>
>> and
>>
>> new_function(&obj, 7);
>>
>> respectively. The internal isomorphisms don't seem to cover this? Or
>> I'm maybe doing something wrong?
>
> There is no isomorphism for that.  Perhaps you cold live with the
> following?
>
> @@
> expression x,e;
> @@
>
> -f
> +g
>   ( \(&x\|x\)
> +, e
>   );
> - \(x.field\|x->field\) = e;

Ah, perfect, thanks!

-Kees

-- 
Kees Cook
Pixel Security
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to