[all-commits] [llvm/llvm-project] 9e2579: Fix infinite recursion during IR emission if a con...

Richard Smith via All-commits all-commits at lists.llvm.org
Mon Mar 1 22:19:51 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e2579dbf434e996b3d35f27b5a1762019cf27bb
      https://github.com/llvm/llvm-project/commit/9e2579dbf434e996b3d35f27b5a1762019cf27bb
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2021-03-01 (Mon, 01 Mar 2021)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGenCXX/temporaries.cpp

  Log Message:
  -----------
  Fix infinite recursion during IR emission if a constant-initialized lifetime-extended temporary object's initializer refers back to the same object.

`GetAddrOfGlobalTemporary` previously tried to emit the initializer of
a global temporary before updating the global temporary map. Emitting the
initializer could recurse back into `GetAddrOfGlobalTemporary` for the same
temporary, resulting in an infinite recursion.

Reviewed By: rjmccall

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




More information about the All-commits mailing list