[flang-commits] [PATCH] D129676: [flang] Ensure name resolution visits "=>NULL()" in entity-decl

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jul 13 11:44:17 PDT 2022


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

Most modern Fortran programs declare procedure pointers with a
procedure-declaration-stmt, but it's also possible to declare one
with a type-declaration-stmt with a POINTER attribute.  In this
case, e.g. "real, external, pointer :: p => null()" the initializer
is required to be a null-init.  The parse tree traversal in name
resolution would visit the null-init if the symbol were an object
pointer only, leading to a crash in the case of a procedure pointer.

That explanation of the bug is longer than the fix.  In short,
ensure that a null-init in an entity-decl is visited for both
species of pointers.


https://reviews.llvm.org/D129676

Files:
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/null-init.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129676.444359.patch
Type: text/x-patch
Size: 4485 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220713/6a8e6520/attachment.bin>


More information about the flang-commits mailing list