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

via flang-commits flang-commits at lists.llvm.org
Wed May 1 12:07:32 PDT 2024


Author: Peter Klausler
Date: 2024-05-01T12:07:28-07:00
New Revision: 71113047298ccb92e6c636a535f0f855a04ee0db

URL: https://github.com/llvm/llvm-project/commit/71113047298ccb92e6c636a535f0f855a04ee0db
DIFF: https://github.com/llvm/llvm-project/commit/71113047298ccb92e6c636a535f0f855a04ee0db.diff

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

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.

Added: 
    

Modified: 
    flang/lib/Semantics/mod-file.cpp

Removed: 
    


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


        


More information about the flang-commits mailing list