commit 1d5cbd6: [Fix] Fix dependencies propagation

Vsevolod Stakhov vsevolod at rspamd.com
Tue May 3 19:35:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-05-03 20:33:56 +0100
URL: https://github.com/rspamd/rspamd/commit/1d5cbd673906c7a3f3852235829c3a1d43c80fa6 (HEAD -> master)

[Fix] Fix dependencies propagation

---
 src/libserver/symcache/symcache_impl.cxx | 2 +-
 src/libserver/symcache/symcache_item.cxx | 9 ++++++++-
 src/libserver/symcache/symcache_item.hxx | 5 +++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/libserver/symcache/symcache_impl.cxx b/src/libserver/symcache/symcache_impl.cxx
index 6b1802d96..ab1b41fc4 100644
--- a/src/libserver/symcache/symcache_impl.cxx
+++ b/src/libserver/symcache/symcache_impl.cxx
@@ -732,7 +732,7 @@ auto symcache::validate(bool strict) -> bool
 			}
 		}
 		else {
-			skipped = FALSE;
+			skipped = false;
 		}
 
 		if (!ghost && skipped) {
diff --git a/src/libserver/symcache/symcache_item.cxx b/src/libserver/symcache/symcache_item.cxx
index c5751ac35..f78605b13 100644
--- a/src/libserver/symcache/symcache_item.cxx
+++ b/src/libserver/symcache/symcache_item.cxx
@@ -136,10 +136,17 @@ auto cache_item::process_deps(const symcache &cache) -> void
 							dep.item = dit->getptr();
 							dep.id = dit->id;
 
-							msg_debug_cache ("added reverse dependency from %d on %d", id,
+							msg_debug_cache ("added reverse dependency from %d on %d", parent->id,
 									dit->id);
 						}
 					}
+					else {
+						dep.item = dit->getptr();
+						dep.id = dit->id;
+						dit->rdeps.emplace_back(getptr(), dep.sym, id, -1);
+						msg_debug_cache ("added reverse dependency from %d on %d", id,
+								dit->id);
+					}
 				}
 			}
 		}
diff --git a/src/libserver/symcache/symcache_item.hxx b/src/libserver/symcache/symcache_item.hxx
index a905df09b..1d0cd7e35 100644
--- a/src/libserver/symcache/symcache_item.hxx
+++ b/src/libserver/symcache/symcache_item.hxx
@@ -265,10 +265,11 @@ public:
 	 */
 	auto is_scoreable() const -> bool
 	{
-		return (type == symcache_item_type::FILTER) ||
+		return !(flags & SYMBOL_TYPE_CALLBACK) &&
+			   ((type == symcache_item_type::FILTER) ||
 			   is_virtual() ||
 			   (type == symcache_item_type::COMPOSITE) ||
-			   (type == symcache_item_type::CLASSIFIER);
+			   (type == symcache_item_type::CLASSIFIER));
 	}
 
 	auto is_ghost() const -> bool


More information about the Commits mailing list