Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Finding usage of the statement "goto" with SmPL
Date: Wed, 9 Dec 2015 15:15:18 +0100	[thread overview]
Message-ID: <56683776.3000602@users.sourceforge.net> (raw)
In-Reply-To: <alpine.DEB.2.10.1512091458390.2491@hadrien>

> It doesn't match anything because when you write a rule that has no *,
> then it is considered that you want the pattern to match on every
> execution path.  It is unlikely that the goto is on every execution path,
> so you get nothing.

This is true.


> To solve the problem, just put exists in the initial @@

Thanks for your quick clarification.

I'm sorry that I overlooked this SmPL script setting somehow.
Now I get also the expected results for this SmPL approach.


function|"source file"|line|column|go_to|label_line|label_column
__zram_make_request|"/home/elfring/Projekte/Linux/next-patched/drivers/block/zram/zram_drv.c"|841|13|out|874|10
?
zram_rw_page|"/home/elfring/Projekte/Linux/next-patched/drivers/block/zram/zram_drv.c"|937|12|put_zram|952|8


> If you don't care about the position of the function header of the
> containing function, but could live with just the function name,

I reuse the information "line" and "column" from this metavariable intentionally.


> you can access it much more efficiently from a position variable on the goto,
> in the field current_element.

I will consider such fine-tuning for other source code analysis.

Regards,
Markus

      reply	other threads:[~2015-12-09 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 13:50 [Cocci] Finding usage of the statement "goto" with SmPL SF Markus Elfring
2015-12-09 14:01 ` Julia Lawall
2015-12-09 14:15   ` SF Markus Elfring [this message]

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=56683776.3000602@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=cocci@systeme.lip6.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