[flang-commits] [flang] [flang] Fix CHECK() crash in module file generator (PR #90234)

via flang-commits flang-commits at lists.llvm.org
Fri Apr 26 09:56:42 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

<details>
<summary>Changes</summary>

A sanity CHECK() in mod-file.cpp needs to allow for USE association of a derived type that has the same name as a locally defined generic interface.

Fixes https://github.com/llvm/llvm-project/issues/90192.

---
Full diff: https://github.com/llvm/llvm-project/pull/90234.diff


1 Files Affected:

- (modified) flang/lib/Semantics/mod-file.cpp (+1-1) 


``````````diff
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp
index 4a531c3c0f99f6..923107210a94cc 100644
--- a/flang/lib/Semantics/mod-file.cpp
+++ b/flang/lib/Semantics/mod-file.cpp
@@ -202,7 +202,7 @@ static void HarvestInitializerSymbols(
           HarvestInitializerSymbols(set, *dtSym.scope());
         }
       } else {
-        CHECK(dtSym.has<UseErrorDetails>());
+        CHECK(dtSym.has<UseDetails>() || dtSym.has<UseErrorDetails>());
       }
     } else if (IsNamedConstant(*symbol) || scope.IsDerivedType()) {
       if (const auto *object{symbol->detailsIf<ObjectEntityDetails>()}) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/90234


More information about the flang-commits mailing list