[flang-commits] [flang] [flang] Fixed a crash in CheckReduce() (PR #156382)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Mon Sep 1 18:34:59 PDT 2025
https://github.com/eugeneepshteyn created https://github.com/llvm/llvm-project/pull/156382
Added extra checks to fix the crash.
Fixes #156167
>From 6014bf06ecb1c0fdfcc5e8fc9b24ece758ed06d8 Mon Sep 17 00:00:00 2001
From: Eugene Epshteyn <eepshteyn at nvidia.com>
Date: Mon, 1 Sep 2025 21:33:35 -0400
Subject: [PATCH] [flang] Fixed a crash in CheckReduce()
Added extra checks to fix the crash.
Fixes #156167
---
flang/lib/Semantics/check-call.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/flang/lib/Semantics/check-call.cpp b/flang/lib/Semantics/check-call.cpp
index a9cfe4d059982..c71b3067c4190 100644
--- a/flang/lib/Semantics/check-call.cpp
+++ b/flang/lib/Semantics/check-call.cpp
@@ -1986,7 +1986,8 @@ static void CheckReduce(
}
}
const auto *result{
- procChars ? procChars->functionResult->GetTypeAndShape() : nullptr};
+ procChars && procChars->functionResult ?
+ procChars->functionResult->GetTypeAndShape() : nullptr};
if (!procChars || !procChars->IsPure() ||
procChars->dummyArguments.size() != 2 || !procChars->functionResult) {
messages.Say(
More information about the flang-commits
mailing list