[flang-commits] [flang] [flang][semantics] fix crash involving equivalences (PR #168909)

Andre Kuhlenschmidt via flang-commits flang-commits at lists.llvm.org
Thu Nov 20 16:04:20 PST 2025


================
@@ -863,8 +863,18 @@ static bool ProcessScopes(const Scope &scope,
       if (std::find_if(associated.begin(), associated.end(), [](SymbolRef ref) {
             return IsInitialized(*ref);
           }) != associated.end()) {
-        result &=
-            CombineEquivalencedInitialization(associated, exprAnalyzer, inits);
+        if (std::find_if(associated.begin(), associated.end(),
+                [](SymbolRef ref) { return !ref->size(); }) !=
+            associated.end()) {
+          // If a symbol has a non-legacy initialization, it won't have a size,
----------------
akuhlens wrote:

I could see if removing the call to `ConvertToInitializers` in `LegacyDataInitialization` would fix the problem too without breaking anything.

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


More information about the flang-commits mailing list