[all-commits] [llvm/llvm-project] c6bb89: [clang] Fix assertion failure when initializing un...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jan 9 00:18:21 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c6bb89f308c6715edf3f35fb7c6257713ecfc614
      https://github.com/llvm/llvm-project/commit/c6bb89f308c6715edf3f35fb7c6257713ecfc614
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/Decl.cpp
    M clang/test/CodeGen/flexible-array-init.c

  Log Message:
  -----------
  [clang] Fix assertion failure when initializing union with FAM (#77298)

When initializing a union that constrain a struct with a flexible array
member, and the initializer list is empty, we currently trigger an
assertion failure. This happens because getFlexibleArrayInitChars()
assumes that the initializer list is non-empty.

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




More information about the All-commits mailing list