[all-commits] [llvm/llvm-project] 85d974: [flang] Fix a crash when creating generics from a ...

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Thu Jul 9 15:50:57 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 85d9745c83a105692a8784b8c8a83482696b4900
      https://github.com/llvm/llvm-project/commit/85d9745c83a105692a8784b8c8a83482696b4900
  Author: Pete Steinfeld <psteinfeld at nvidia.com>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M flang/include/flang/Semantics/symbol.h
    M flang/lib/Semantics/symbol.cpp
    M flang/test/Semantics/resolve53.f90

  Log Message:
  -----------
  [flang] Fix a crash when creating generics from a copy

Summary:
When a program unit creates a generic based on one defined in a module, the
function `CopyFrom()` is called to create the `GenericDetails`.  This function
copied the `specificProcs_` but failed to copy the `bindingNames_`.  If the
function `CheckGeneric()` then gets called, it tries to index into the empty
binding names and causes the crash.

I fixed this by adding code to `CopyFrom()` to copy the binding names.

I also added a test that causes the crash.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm, #flang

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




More information about the All-commits mailing list