[all-commits] [llvm/llvm-project] f85a9a: [randstruct] Don't allow implicit forward decl to ...

Bill Wendling via All-commits all-commits at lists.llvm.org
Mon Feb 6 14:26:57 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f85a9a6452e8f49f9768d66a86434a88a5891614
      https://github.com/llvm/llvm-project/commit/f85a9a6452e8f49f9768d66a86434a88a5891614
  Author: Bill Wendling <morbo at google.com>
  Date:   2023-02-06 (Mon, 06 Feb 2023)

  Changed paths:
    M clang/lib/Sema/SemaDecl.cpp
    A clang/test/CodeGen/init-randomized-struct-fwd-decl.c

  Log Message:
  -----------
  [randstruct] Don't allow implicit forward decl to stop struct randomization

If a struct/enum type used in a record doesn't have a forward decl /
def, an implicit one is injected into the struct. This stops clang from
randomizing the structure in some situations---i.e. when the struct
contains only function pointers. So we accept forward decls so they
don't prevent randomization.

Fixes 60349

Reviewed By: MaskRay, nickdesaulniers

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




More information about the All-commits mailing list