summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-08-12 11:48:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-08-12 19:13:07 +0200
commited887c85ef2463af1d9c8cbf67c45f6afd4c4d48 (patch)
treefd7afba2abff30b78ae0a0a1ceb20a66bc9ae215 /compilerplugins/clang
parent2e77a93b10399b31882dbba5e5b1f2211f6b5e42 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/dyncastvisibility.cxx4
1 files changed, 3 insertions, 1 deletions
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