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 <jaskaransingh7654...@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

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to