File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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 ) &&
You can’t perform that action at this time.
0 commit comments