On Sat, 22 Jun 2019, Markus Elfring wrote:
> >> elfring@Sonne:~/Projekte/Linux/next-patched> spatch
> >> ~/Projekte/Coccinelle/janitor/show_questionable_variable_initialisation1.cocci
> >> drivers/misc/lkdtm/core.c
> >> …
> >> exn while in timeout_function
> >> Fatal error: exception Coccinelle_modules.Common.Impossible(56)
> >>
> >>
> >> How do you think about the software situation?
> >
> > This problem is now fixed.
>
> Another aspect was improved also for the Coccinelle software.
>
> The following SmPL script variant can point source code places out for
> further considerations.
>
> @display@
> binary operator bo;
> expression e1, e2, e3, call;
> identifier var;
> statement is, es;
> type t;
> @@
> *t var = e1;
> ... when != if ( \( var bo e2 \| var \) ) is else es
> when != call(..., var, ...)
> when exists
> *var = e3
It could be helpful to replace the last line by:
(
e3 = <+...var...+>
|
* var = e3
)
In that case, it would also be beneficial to remove the * on the variable
declaration because that will be activated regardless of which branch
matches in the disjunction.
julia
>
>
> But it seems that data flow analysis would be needed to exclude remaining
> false positives for such a source code search pattern.
>
> Regards,
> Markus
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci