[all-commits] [llvm/llvm-project] 292968: [clang][codegen] Fix emission of consteval constru...

Mariya Podchishchaeva via All-commits all-commits at lists.llvm.org
Thu Feb 9 01:54:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2929683eef27e6b3ac95325d955cd39bc2e416c0
      https://github.com/llvm/llvm-project/commit/2929683eef27e6b3ac95325d955cd39bc2e416c0
  Author: Mariya Podchishchaeva <mariya.podchishchaeva at intel.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/CodeGen/CGExprAgg.cpp
    M clang/test/CodeGenCXX/cxx20-consteval-crash.cpp

  Log Message:
  -----------
  [clang][codegen] Fix emission of consteval constructor of derived type

For simple derived type ConstantEmitter returns a struct of the same
size but different type which is then stored field-by-field into memory
via pointer to derived type. In case base type has more fields than derived,
the incorrect GEP is emitted. So, just cast pointer to derived type to
appropriate type with enough fields.

Fixes https://github.com/llvm/llvm-project/issues/60166

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list