[Linux-kernel-mentees] [PATCH 3/3] parsing_cocci: unify_ast: Apply unify_mcode on macrodecl attrs

Jaskaran Singh jaskaransingh7654321 at gmail.com
Fri Jun 12 06:45:44 UTC 2020


The following commit introduced some poor management of attributes in
unify_ast.ml:
	b4b8653bd5a9607922e0050fe2fede10d422b218
Apply unify_mcode on macrodecl attributes in unify_ast.ml.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
 parsing_cocci/unify_ast.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/parsing_cocci/unify_ast.ml b/parsing_cocci/unify_ast.ml
index 752e9283..788c8fdc 100644
--- a/parsing_cocci/unify_ast.ml
+++ b/parsing_cocci/unify_ast.ml
@@ -413,7 +413,8 @@ and unify_declaration d1 d2 =
        else false
   | (Ast.MacroDecl(s1,n1,lp1,args1,rp1,attr1,sem1),
      Ast.MacroDecl(s2,n2,lp2,args2,rp2,attr2,sem2)) ->
-       if bool_unify_option unify_mcode s1 s2
+       if bool_unify_option unify_mcode s1 s2 &&
+         List.for_all2 unify_mcode attr1 attr2
        then
 	 unify_ident n1 n2 &&
 	 unify_dots unify_expression edots args1 args2
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list