[all-commits] [llvm/llvm-project] 8f7fdd: [clang][AST] Invalidate DecompositionDecl if it ha...

Haojian Wu via All-commits all-commits at lists.llvm.org
Wed Jan 17 03:11:28 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f7fdd94ef19af7b4905b316c253a78219a6038f
      https://github.com/llvm/llvm-project/commit/8f7fdd94ef19af7b4905b316c253a78219a6038f
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2024-01-17 (Wed, 17 Jan 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/AST/ast-dump-invalid-initialized.cpp

  Log Message:
  -----------
  [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (#72428)

Fix #67495, #72198

We build ill-formed AST nodes for invalid structured binding. For case
`int [_, b] = {0, 0};`, the `DecompositionDecl` is valid, and its
children `BindingDecl`s are valid but with a NULL type, this breaks
clang invariants in many places, and using these `BindingDecl`s can lead
to crashes. This patch fixes them by marking the DecompositionDecl and
its children invalid.




More information about the All-commits mailing list