Skip to content

Commit 386a18c

Browse files
committed
Undo mistaken change
1 parent c4619c1 commit 386a18c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flang/lib/Lower/OpenMP/Clauses.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,12 @@ std::optional<Object> getBaseObject(const Object &object,
160160
ea.Designate(evaluate::DataRef{
161161
SymbolAndDesignatorExtractor::AsRvalueRef(*comp)})};
162162
} else if (auto *symRef = base.UnwrapSymbolRef()) {
163-
return Object{const_cast<semantics::Symbol *>(&**symRef), std::nullopt};
163+
// This is the base symbol of the array reference, which is the same
164+
// as the symbol in the input object,
165+
// e.g. A(i) is represented as {Symbol(A), Designator(ArrayRef(A, i))}.
166+
// Here we have the Symbol(A), which is what we started with.
167+
assert(&**symRef == object.sym());
168+
return std::nullopt;
164169
}
165170
} else {
166171
assert(std::holds_alternative<evaluate::CoarrayRef>(ref.u) &&

0 commit comments

Comments
 (0)