MetaAttribute is added to the SmPL AST. Reflect these changes in
cleanup_rules.ml.

Signed-off-by: Jaskaran Singh <jaskaran.si...@collabora.com>
---
 parsing_cocci/cleanup_rules.ml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/parsing_cocci/cleanup_rules.ml b/parsing_cocci/cleanup_rules.ml
index 7f03f98fd..e11484539 100644
--- a/parsing_cocci/cleanup_rules.ml
+++ b/parsing_cocci/cleanup_rules.ml
@@ -244,6 +244,14 @@ let statement r k s =
   | Ast.OptStm(_) -> s
   | _ -> k s
 
+let attribute r k a =
+  match Ast.unwrap a with
+    Ast.MetaAttribute(name,_,_,_) ->
+      (if List.mem (get_rule name) !dropped
+      then set_failed !drop_stack);
+      k a
+  | _ -> k a
+
 let do_cleanup =
   let donothing r k e = k e in
   V.rebuilder
@@ -254,7 +262,7 @@ let do_cleanup =
     ident expression string_fragment string_format assignOp
     binaryOp fullType typeC initialiser parameterTypeDef define_param
     declaration donothing field ann_field donothing
-    rule_elem statement donothing donothing donothing donothing
+    rule_elem statement donothing attribute donothing donothing
 
 let cleanup_rules rules d =
   dropped := d;
-- 
2.21.3

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

Reply via email to