It turned out that the root cause of the crash was that the length of the type
of the symbol being passed to SymbolLEN() had a bad expression. So I fixed
it by checking isExplicit() on the ParamValue before calling
GetExplicit(). The case where isExplicit() returned true and
GetExplicit() failed to get an expression indicates a prior error, so I just
returned std::nullopt from SymbolLEN() and avoided the call to the
constructor of DescriptorInquiry.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please leave the batteries installed in this particular smoke detector and see whether you can stop the annoying noise by extinguishing the fire instead. We don't want to be able to construct erroneous descriptor inquiries into things that aren't descriptors!
- Updating D80593: [flang] Fixed crash on forward referenced len parameter #
- Enter a brief description of the changes included in this update.
- The first line is used as subject, next lines as comment. #
- If you intended to create a new revision, use:
- $ arc diff --create
It turned out that the root cause of the crash was that the length of the type
of the symbol being passed to SymbolLEN() had a bad expression. So I fixed
it by checking isExplicit() on the ParamValue before calling
GetExplicit(). The case where isExplicit() returned true and
GetExplicit() failed to get an expression indicates a prior error, so I just
returned std::nullopt from SymbolLEN() and avoided the call to the
constructor of DescriptorInquiry.
I restored the calls to variable.cpp to CHECK(IsDescriptor(last)).
@klausler, you requested changes. Does the current state of this revision look good to you?