The example could be simplified to:

Thanks for your hint.


The reason is that ... matches the shortest path between what is before the ...
and what is after (implicitly the end of the function in this case).

Would you like to add this explanation for the behaviour of the SmPL ellipsis to the documentation?


The semantic patch is also unnecessarily verbose. Actually (a)->c is an
expression, so any code that it matches would also be matched by (x).

I have imagined that the discussed expression needs specific constraints for the use of the access operators "." and "->" so that calls to member functions which do not perform input parameter validation will be properly identified.

Does an expression cover more than this use case?


Furthermore, you can reuse metavariables between disjunction branches,
eg c and d can be the same metavariable in is_assigned. And you can also reuse
metavariables between a sequence of whens.

I admit that I am still unsure when metavariables can be reused for pattern alternatives. I would like to avoid potential conflicts because of the same name at several places in a SmPL rule.

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to