[RFC PATCH 11/20] check if functions need to be adapted

Asbjørn Sloth Tønnesen ast at 2e8.dk
Mon Dec 30 17:56:37 CET 2019


---
 filter/adapt.c  | 7 +++++++
 filter/config.Y | 1 +
 filter/filter.h | 1 +
 3 files changed, 9 insertions(+)

diff --git a/filter/adapt.c b/filter/adapt.c
index b1223169..cb43177d 100644
--- a/filter/adapt.c
+++ b/filter/adapt.c
@@ -29,3 +29,10 @@ filter_tree_has_typed_symbols(const struct f_tree *t)
 
   return 0;
 }
+
+void
+filter_validate_function(struct symbol *sym)
+{
+  if (f_has_typed_symbols(sym->function))
+    sym->flags |= SYM_FLAG_DO_ADAPT;
+}
diff --git a/filter/config.Y b/filter/config.Y
index c8b868af..1caef0fc 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -615,6 +615,7 @@ function_def:
      $5->args = $4;
      $2->function = $5;
      cf_pop_scope();
+     filter_validate_function($2);
    }
  ;
 
diff --git a/filter/filter.h b/filter/filter.h
index 7c4b0ae9..33c452e8 100644
--- a/filter/filter.h
+++ b/filter/filter.h
@@ -65,6 +65,7 @@ int f_same(const struct f_line *f1, const struct f_line *f2);
 
 int f_has_typed_symbols(const struct f_line *line);
 int filter_tree_has_typed_symbols(const struct f_tree *t);
+void filter_validate_function(struct symbol *sym);
 
 void filter_commit(struct config *new, struct config *old);
 
-- 
2.24.0



More information about the Bird-users mailing list