compilerplugins/clang/dyncastvisibility.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit ed887c85ef2463af1d9c8cbf67c45f6afd4c4d48
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Aug 12 11:48:43 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Aug 12 19:13:07 2024 +0200

    fix clang crash
    
    with clang version 17.0.6 on openSUSE 15.6 we seem to be getting a crash
    here (originally reported to me by mmeeks)
    
    Change-Id: I7b0b1b986a7f66af988e58d4fec019b9e29a64da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171754
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/dyncastvisibility.cxx 
b/compilerplugins/clang/dyncastvisibility.cxx
index 7259374c98ea..7d6b19aa6e24 100644
--- a/compilerplugins/clang/dyncastvisibility.cxx
+++ b/compilerplugins/clang/dyncastvisibility.cxx
@@ -107,7 +107,9 @@ public:
             return true;
         }
         auto const rdd = cast<CXXRecordDecl>(rtd->getDecl())->getDefinition();
-        assert(rdd != nullptr);
+        if (rdd == nullptr) {
+            return true;
+        }
         if (getTypeVisibility(rdd) != DefaultVisibility) {
             // Heuristic to find problematic dynamic_cast<T> with hidden type 
T is: T is defined in
             // include/M1/ while the compilation unit is in module M2/ with M1 
!= M2.  There are

Reply via email to