> Remember that ... matches the shortest path between what is before and 
> what is after.  So if there is another if test on the same data in the 
> function, that will cause a failure.  If yo udon't care to have this 
> constraint, you can put when any on a ...

The following pattern variant does not show a different analysis result.

@is_unnecessary_check@
expression data;
identifier work;
identifier release =~ "^kz?free$";
position pos;
type t;
@@
 t work@pos(...)
 {
  ... when any
( if (data) release(data);
| if (likely(data)) release(data);
)
  ... when any
 }

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to