[flang-commits] [PATCH] D143211: [flang] Avoid infinite recursion in common block check

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Feb 2 12:58:49 PST 2023


klausler accepted this revision.
klausler added a comment.
This revision is now accepted and ready to land.

Looks great to me; thanks for digging into this bug and coming up with a good fix.  If you're feeling really ambitious, consider moving this whole common block checking task out of name resolution and into declaration checking (Semantics/check-declarations.cpp) which would be a more natural home for this code.



================
Comment at: flang/lib/Semantics/resolve-names.cpp:5738
           if (const auto *derived{type->AsDerived()}) {
-            CheckCommonBlockDerivedType(name, derived->typeSymbol());
+            const Symbol &derivedTypeSymbol = derived->typeSymbol();
+            // Don't call this method recursively if the derived type symbol
----------------
Please always use braced initializers in semantics.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:5739
+            const Symbol &derivedTypeSymbol = derived->typeSymbol();
+            // Don't call this method recursively if the derived type symbol
+            // is the same symbol that is already being processed.
----------------
s/method/member function/


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143211/new/

https://reviews.llvm.org/D143211



More information about the flang-commits mailing list