forked from OSchip/llvm-project
[flang] Do not add invalid subscript triple to whole assumed-size array reference
Original-commit: flang-compiler/f18@71c134a552 Reviewed-on: https://github.com/flang-compiler/f18/pull/597 Tree-same-pre-rewrite: false
This commit is contained in:
parent
52df04445e
commit
7c03f03c67
|
@ -156,6 +156,11 @@ MaybeExpr ExpressionAnalyzer::CompleteSubscripts(ArrayRef &&ref) {
|
|||
int symbolRank{symbol.Rank()};
|
||||
int subscripts{static_cast<int>(ref.size())};
|
||||
if (subscripts == 0) {
|
||||
if (semantics::IsAssumedSizeArray(symbol)) {
|
||||
// Don't introduce a triplet that would later be caught
|
||||
// as being invalid.
|
||||
return Designate(DataRef{std::move(ref)});
|
||||
}
|
||||
// A -> A(:,:)
|
||||
for (; subscripts < symbolRank; ++subscripts) {
|
||||
ref.emplace_back(Triplet{});
|
||||
|
|
Loading…
Reference in New Issue