[all-commits] [llvm/llvm-project] 4f2b65: [flang] Fix references to destroyed objects (#111582)

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Oct 10 10:25:40 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f2b65fb80a4b27e5fb88db816ed0ce174c9b1b4
      https://github.com/llvm/llvm-project/commit/4f2b65fb80a4b27e5fb88db816ed0ce174c9b1b4
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2024-10-10 (Thu, 10 Oct 2024)

  Changed paths:
    A flang/include/flang/Semantics/program-tree.h
    M flang/include/flang/Semantics/semantics.h
    M flang/lib/Semantics/program-tree.cpp
    R flang/lib/Semantics/program-tree.h
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/semantics.cpp

  Log Message:
  -----------
  [flang] Fix references to destroyed objects (#111582)

ProgramTree instances are created as the value of a local variable in
the Pre(const parser::ProgramUnit &) member function in name resolution.
But references to these ProgramTree instances can persist in
SubprogramNameDetails symbol table entries that might survive that
function call's lifetime, and lead to trouble later when (e.g.)
expression semantics needs to deal with a possible forward reference in
a function reference in an expression being processed later in
expression checking.

So put those ProgramTree instances into a longer-lived linked list
within the SemanticsContext.

Might fix some weird crashes reported on big-endian targets (AIX &
Solaris).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list