[flang] Fix handling of DataRef when analyzing CoindexedNamedObject
authorTim Keith <tkeith@nvidia.com>
Sat, 7 Mar 2020 01:05:04 +0000 (17:05 -0800)
committerTim Keith <tkeith@nvidia.com>
Tue, 10 Mar 2020 00:25:12 +0000 (17:25 -0700)
commit0b130278a0eb1250e66d57e3c74253d4f0080106
treeed02d1791c60f88df96181a39863a778a209577f
parente0ca7b447b5424bfecd8f6541d987108ca81a856
[flang] Fix handling of DataRef when analyzing CoindexedNamedObject

As we loop through the Components, maintain a pointer to the current
DataRef rather than moving it. This is more efficient and the previous
behavior caused illegal memory accesses.

Original-commit: flang-compiler/f18@cede2971ff863b8dd6a2c8727f6566a444ac7a52
Reviewed-on: https://github.com/flang-compiler/f18/pull/1050
Tree-same-pre-rewrite: false
flang/lib/Semantics/expression.cpp