public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
From: Mats Kindahl <mats.kindahl@gmail.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: cocci@inria.fr
Subject: Re: [cocci] Depends on with negative matches
Date: Sat, 21 Dec 2024 15:24:07 +0100	[thread overview]
Message-ID: <0146ddc0-016a-481a-89e7-b83a8493df6c@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2412202253060.4924@hadrien>

Hi Julia,

Thanks you! I feel really stupid, but now it works. My only excuse is 
that the documentation for "when != true <expr>" is not very elaborate. :)

Thanks again Julia,
Mats Kindahl

On 2024-12-20 22:54, Julia Lawall wrote:
> I think you just had true and false backwards:
>
> // Capture any malloc() to a local variable
> @r@
> local idexpression var;
> position p;
> @@
>    var@p = malloc(...)
>
> @@
> local idexpression r.var;
> position r.p;
> @@
> * var@p = malloc(...);
>    ... when != true !PointerIsValid(var)
>        when != false PointerIsValid(var)
>        when != free(var)
>        when != return (var);
>
> For example, you don't want to complain if there is a path with no free,
> but that path goes through a failing pointer is valid test.
>
> julia

  parent reply	other threads:[~2024-12-21 14:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19  7:25 [cocci] Depends on with negative matches Mats Kindahl
2024-12-19  7:53 ` Julia Lawall
2024-12-19 18:55   ` Mats Kindahl
2024-12-19 19:54     ` Markus Elfring
2024-12-20 21:54     ` Julia Lawall
2024-12-21  9:08       ` Markus Elfring
2024-12-21 14:24       ` Mats Kindahl [this message]
2024-12-21 14:25         ` Julia Lawall
2024-12-21 16:14         ` Markus Elfring
2024-12-19  9:52 ` [cocci] Detecting missing resource releases (with SmPL)? Markus Elfring
2024-12-19 11:32 ` [cocci] Scope for source code analyses " Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0146ddc0-016a-481a-89e7-b83a8493df6c@gmail.com \
    --to=mats.kindahl@gmail.com \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox