[Linux-kernel-mentees] [PATCH 1/2] parsing_cocci: parse_cocci: Fix struct pointer funcall regression

Jaskaran Singh jaskaransingh7654321 at gmail.com
Wed May 13 07:29:50 UTC 2020

This is a fix in response to the following bug report:


The following commit:


Introduces a regression in the following SmPL use case:

	struct s *x;


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 at 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(_),_)::_

More information about the Linux-kernel-mentees mailing list