Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2024

Conversation

klausler
Copy link
Contributor

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 #90192.

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 llvm#90192.
@llvmbot
Copy link
Member

llvmbot commented Apr 26, 2024

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

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 #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 --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>()}) {

Copy link
Contributor

@clementval clementval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Sorry this one slipped under my radar

@klausler klausler merged commit 7111304 into llvm:main May 1, 2024
@klausler klausler deleted the bug90192 branch May 1, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flang] fatal internal error: CHECK(dtSym.has<UseErrorDetails>()) failed at /root/llvm-project/flang/lib/Semantics/mod-file.cpp(205)
3 participants