projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14b648a
)
[flang] Prevent crash in error case: elemental with alternate return
author
Peter Klausler
<pklausler@nvidia.com>
Fri, 16 Dec 2022 23:10:50 +0000
(15:10 -0800)
committer
Peter Klausler
<pklausler@nvidia.com>
Sat, 17 Dec 2022 00:45:51 +0000
(16:45 -0800)
When an ELEMENTAL subroutine is erroneously declared with alternate return
arguments, don't crash when checking the ranks of the actual arguments.
Differential Revision: https://reviews.llvm.org/D140143
flang/lib/Semantics/check-call.cpp
patch
|
blob
|
history
diff --git
a/flang/lib/Semantics/check-call.cpp
b/flang/lib/Semantics/check-call.cpp
index
76cb96c
..
104ea7a
100644
(file)
--- a/
flang/lib/Semantics/check-call.cpp
+++ b/
flang/lib/Semantics/check-call.cpp
@@
-891,7
+891,7
@@
static bool CheckElementalConformance(parser::ContextualMessages &messages,
int index{0};
bool hasArrayArg{false};
for (const auto &arg : actuals) {
- if (arg &&
arg.value().
Rank() > 0) {
+ if (arg &&
!arg->isAlternateReturn() && arg->
Rank() > 0) {
hasArrayArg = true;
break;
}