[flang] Fixed crash on forward referenced `len` parameter

Authored by Pete Steinfeld <psteinfeld@nvidia.com> on May 26 2020, 3:12 PM.


[flang] Fixed crash on forward referenced len parameter

Using a forward reference to define a len parameter causes a crash.
The underlying cause was that a previously declared type had an
erroneous expression for its LEN param value. When this expression
was referenced to evaluate a subsequent expression, bad things happened.
I fixed this by putting in code to detect this case.

Reviewers: tskeith, klausler, DavidTruby

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80593