Re: [cocci] Searching for duplicate exception handling code with SmPL?

Julia Lawall <[email protected]> Mon, 15 Jun 2026 18:05:26 +0200 (CEST)
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-2000011710-1781539526=:3490
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT



On Mon, 15 Jun 2026, Markus Elfring wrote:

> >>>> info|device_str_attr_create|s|NULL
> >>>> first|./arch/powerpc/perf/hv-24x7.c|506|2
> >>>> tail|./arch/powerpc/perf/hv-24x7.c|506|2
> >>
> >> Should it be avoided anyhow that the mentioned source code positions become the same?
> >
> > Coccinelle has nothing built in to do that.
>
> I suggest to reconsider such a view in more detail.
>
> I would appreciate more clarity about corresponding software functionality.
>
> How can separately specified if branches be “merged” into the same place?
>
>
> >                                              If you want some effect you
> > have to express that yourself in the rule.
> I can try to avoid known open issues by additional OCaml/Python scripting.
>
> But it seems that I need to know some technical details better accordingly.

Do whatever you want.  It seems that the problem is that gotos lead to the
same place where a single kfree is found.  So forbidding gotos on the path
would avoid false positives.  Perhaps it is not a perfect solution.  A
more perfect solution may require a dedicated tool.

julia
--8323329-2000011710-1781539526=:3490--