[PATCH] D98430: [flang] Handle type-bound procedures with alternate returns
Pete Steinfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 11 08:24:47 PST 2021
PeteSteinfeld created this revision.
PeteSteinfeld added reviewers: klausler, tskeith.
PeteSteinfeld requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
If you specify a type-bound procedure with an alternate return, there
will be no symbol associated with that dummy argument. In such cases,
the compiler's list of dummy arguments will contain a nullptr. In our
analysis of the PASS arguments of type-bound procedures, we were
assuming that all dummy arguments had non-null symbols associated with
them and were using that assumption to get the name of the dummy
argument. This caused the compiler to try to dereference a nullptr.
I fixed this by explicitly checking for a nullptr and, in such cases, emitting
an error message. I also added tests that contain type-bound procedures with
alternate returns in both legal and illegal constructs to ensure that semantic
analysis is working for them.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D98430
Files:
flang/lib/Semantics/check-declarations.cpp
flang/test/Semantics/bindings01.f90
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98430.329975.patch
Type: text/x-patch
Size: 2474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210311/63bebb7d/attachment.bin>
More information about the llvm-commits
mailing list