[all-commits] [llvm/llvm-project] 3e41ab: [flang] Fix dangling pointer in LabelEnforce

Tim Keith via All-commits all-commits at lists.llvm.org
Thu Jan 14 06:57:53 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e41ab18db2255028c288a11665c08d260654299
      https://github.com/llvm/llvm-project/commit/3e41ab18db2255028c288a11665c08d260654299
  Author: Tim Keith <tkeith at nvidia.com>
  Date:   2021-01-14 (Thu, 14 Jan 2021)

  Changed paths:
    M flang/lib/Semantics/check-directive-structure.h

  Log Message:
  -----------
  [flang] Fix dangling pointer in LabelEnforce

`DirectiveStructureChecker` was passing in a pointer to a temporary
string for the `construct` argument to the constructor for `LabelEnforce`.
The `LabelEnforce` object had a lifetime longer than the temporary,
resulting in accessing a dangling pointer when emitting an error message
for `omp-parallell01.f90`.

The fix is to make the lifetime of the temporary as long as the lifetime
of the `LabelEnforce` object.

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




More information about the All-commits mailing list