From: Jaskaran Singh <jaskaransingh7654321@gmail.com>
To: cocci@systeme.lip6.fr
Cc: julia.lawall@inria.fr, jaskaransingh7654321@gmail.com,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: [Linux-kernel-mentees] [PATCH 1/2] parsing_cocci: parse_cocci: Fix struct pointer funcall regression
Date: Wed, 13 May 2020 12:59:50 +0530 [thread overview]
Message-ID: <20200513072951.3453-2-jaskaransingh7654321@gmail.com> (raw)
In-Reply-To: <20200513072951.3453-1-jaskaransingh7654321@gmail.com>
This is a fix in response to the following bug report:
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg07332.html
The following commit:
c280375635f62dfbe052709e4e47a82140d32ce5
Introduces a regression in the following SmPL use case:
@@
struct s *x;
@@
x->func();
Where x is a pointer to a struct and func is a function belonging to
said struct. The faulty commit mislabels func as a function prototype
due to a missing case in the function-prototype-detection match ladder.
Add a case in the match ladder for a struct pointer function call.
Signed-off-by: Jaskaran Singh <jaskaransingh7654321@gmail.com>
---
parsing_cocci/parse_cocci.ml | 1 +
1 file changed, 1 insertion(+)
diff --git a/parsing_cocci/parse_cocci.ml b/parsing_cocci/parse_cocci.ml
index 292ee5c0..798abc27 100644
--- a/parsing_cocci/parse_cocci.ml
+++ b/parsing_cocci/parse_cocci.ml
@@ -1076,6 +1076,7 @@ let find_function_names l =
| (PC.TMetaId(_),_)::_
| (PC.TMetaLocalIdExp(_),_)::_
| (PC.TEq(_),_)::_
+ | (PC.TPtrOp(_),_)::_
| (PC.TEllipsis(_),_)::_
| (PC.TOEllipsis(_),_)::_
| (PC.TCEllipsis(_),_)::_
--
2.21.1
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2020-05-13 7:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 7:29 [Linux-kernel-mentees] [PATCH 0/2] parsing_cocci: Fix struct pointer funcall regression Jaskaran Singh
2020-05-13 7:29 ` Jaskaran Singh [this message]
2020-05-13 7:29 ` [Linux-kernel-mentees] [PATCH 2/2] tests: Add test case for struct pointer function call Jaskaran Singh
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=20200513072951.3453-2-jaskaransingh7654321@gmail.com \
--to=jaskaransingh7654321@gmail.com \
--cc=cocci@systeme.lip6.fr \
--cc=julia.lawall@inria.fr \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
/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;
as well as URLs for NNTP newsgroup(s).