cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* Re: [Cocci] How to handle parts of expressions?
@ 2020-06-04  8:15 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2020-06-04  8:15 UTC (permalink / raw)
  To: Denis Efremov; +Cc: cocci

> I'm trying to write a rule to match consecutive function calls. For example:
> @r@
> expression E, E1;
> @@
>
>   call_func(E);
>   ... when != E = E1
> * call_func(E);
>
> It works well, but not in case "E == p->f" and p is updated in between calls.
> So, I'm to understand how can I avoid these kind of pointers update.

You would like to exclude assignments between calls of functions
with a single parameter. The specified metavariable type is obviously used
in the generic way so far.
Would you like to add any constraints on the modification for identifiers
within expressions?


> And fail case example:
…
void test(void)
{
…
	for(i = t; i < i + 10; ++i) {
		call_func(i->a);
	}
}


I imagine that the interpretation of this software example will depend
also on applied technologies like the following.

1. Computation tree logic
   Can it be there are no consecutive function calls because a single statement
   was specified (for the loop)?
   (See also: Option “--no-loops”)
   https://github.com/coccinelle/coccinelle/blob/7cf2c23e64066d5249a64a316cc5347831f7a63f/docs/manual/spatch_options.tex#L350

2. Linear temporal logic
   Statements would be consecutive if loop unrolling would be performed.


> While I tried to figure it out, I faced some cocci constructions with no documentation.

How do you think about to influence this software situation any more?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-04  8:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04  8:15 [Cocci] How to handle parts of expressions? Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).