From dd05354924c71c1074a589db9b7475e81f212d39 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Jun 2024 12:17:02 +0200 Subject: Instrument header cache inconsistency assert with additional info (GH issue #390) --- libbuild2/cc/compile-rule.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index 7629ed5..95ba89f 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -3213,7 +3213,21 @@ namespace build2 if (f != nullptr) { //cache_cls.fetch_add (1, memory_order_relaxed); + +#if 0 assert (r.first == f); +#else + if (r.first != f) + { + info << "inconsistent header cache content" << + info << "encountered: " << *f << + info << "expected: " << *r.first << + info << "please report at " + << "https://github.com/build2/build2/issues/390"; + + assert (r.first == f); + } +#endif } } -- cgit v1.1