[all-commits] [llvm/llvm-project] 609fe2: [ObjC] Fix offsets following `[[no_unique_address]...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Mon Nov 6 11:37:01 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 609fe2cb4b2037b546686d5f50c2f330dbca4111
      https://github.com/llvm/llvm-project/commit/609fe2cb4b2037b546686d5f50c2f330dbca4111
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
    M clang/lib/AST/ASTContext.cpp
    M clang/test/CodeGenObjCXX/encode.mm

  Log Message:
  -----------
  [ObjC] Fix offsets following `[[no_unique_address]]` for `@encode()` (#71321)

Commit 46ca880fca made `@encode` skip fields that are made zero-sized by
`[[no_unique_address]]`. When iterating the fields, the index which is
passed to `getFieldOffset` failed to be incremented for those due to the
use of an early `continue`, so subsequent fields reported an incorrect
offset. This caused an assertion to be triggered in
`getObjCEncodingForStructureImpl`.

Fixes #71250




More information about the All-commits mailing list