[all-commits] [llvm/llvm-project] 0406c0: [flang] Ensure name resolution visits "=>NULL()" i...

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed Jul 13 16:36:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0406c0cda675f3cb7d294a3e65eb4f19c9efe98b
      https://github.com/llvm/llvm-project/commit/0406c0cda675f3cb7d294a3e65eb4f19c9efe98b
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-07-13 (Wed, 13 Jul 2022)

  Changed paths:
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Semantics/null-init.f90

  Log Message:
  -----------
  [flang] Ensure name resolution visits "=>NULL()" in entity-decl

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.

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




More information about the All-commits mailing list