[all-commits] [llvm/llvm-project] a24421: [flang][bbc] Fix dangling reference to `envDefault...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Fri Feb 23 10:51:37 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a24421fef713e5b3c0a885cf36a62cc3257be1f3
      https://github.com/llvm/llvm-project/commit/a24421fef713e5b3c0a885cf36a62cc3257be1f3
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2024-02-23 (Fri, 23 Feb 2024)

  Changed paths:
    M flang/tools/bbc/bbc.cpp

  Log Message:
  -----------
  [flang][bbc] Fix dangling reference to `envDefaults` (#82800)

The lowering bridge stores the evvironment defaults (passed to the
constructor) as a reference. In the call to the constructor in bbc, the
defaults were passed as `{}`, which creates a temporary whose lifetime
ends immediately after the call.

The flang driver passes a member of the compilation instance to the
constructor, which presumably remains alive long enough, so storing the
reference in the bridge is justified. To avoid the dangling reference,
create an actual object `envDefaults` in bbc.



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