[cocci] Avoiding duplicate elements in SmPL disjunctions?

Markus Elfring <[email protected]>
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
Hello,

I tried the following script variant out for the semantic patch language.

@display@
statement s;
@@
*while (1)
    s


Questionable test result (according to the software combination “Coccinelle 1.3.0”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> /usr/bin/spatch --parse-cocci show_unlimited_while_loops.cocci
…
(
*while *(*1*) 
|
*while *(*1 *!= *0*) 
|
*while *(*1*) 
|
*while *(*0 *!= *1*) 
)s
…


An element of the generated SmPL disjunction got repeated somehow.
How do you think about to avoid such duplicate code?

Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.