[flang-commits] [flang] [flang] Fix for runtime crash for huge local array (PR #205270)

via flang-commits flang-commits at lists.llvm.org
Mon Jun 22 23:47:46 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- flang/lib/Lower/PFTBuilder.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Lower/PFTBuilder.cpp b/flang/lib/Lower/PFTBuilder.cpp
index 4b5227572..e8bff1f79 100644
--- a/flang/lib/Lower/PFTBuilder.cpp
+++ b/flang/lib/Lower/PFTBuilder.cpp
@@ -1624,8 +1624,7 @@ bool Fortran::lower::symbolIsGlobal(const semantics::Symbol &sym) {
   return (semantics::IsSaved(sym) && semantics::CanCUDASymbolBeGlobal(sym)) ||
          lower::definedInCommonBlock(sym) || semantics::IsNamedConstant(sym) ||
          (sym.Rank() > 0 && sym.size() > largeLocalArrayBytes &&
-          !semantics::IsDummy(sym) &&
-          !semantics::IsAllocatableOrPointer(sym) &&
+          !semantics::IsDummy(sym) && !semantics::IsAllocatableOrPointer(sym) &&
           scope.kind() == semantics::Scope::Kind::Subprogram && proc &&
           !proc->attrs().test(semantics::Attr::RECURSIVE));
 }

``````````

</details>


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


More information about the flang-commits mailing list