[flang] Fix a crash when cosubscript list is empty
authorPete Steinfeld <psteinfeld@nvidia.com>
Wed, 8 Jul 2020 17:05:04 +0000 (10:05 -0700)
committerPete Steinfeld <psteinfeld@nvidia.com>
Wed, 8 Jul 2020 17:11:34 +0000 (10:11 -0700)
commit9520b6c8ab63061e1734deef8614eaa60f704dc9
treedb644030deb8a27fbfb439731128bbd7fa08c43d
parent1eaad01046c88be6bf65265a2bcc53db5a5b48d0
[flang] Fix a crash when cosubscript list is empty

Summary:
When there are errors in the evaluation of every cosubscript expression in a
coindexed object, the compiler would crash.  I fixed this by just checking to
see if there were errors in the evaluation of the cosubscripts before
constructing the `DataRef` for the coindexed object.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83410
flang/lib/Semantics/expression.cpp
flang/test/Semantics/resolve94.f90