[PATCH] D135727: [clang] Correct sanitizer behavior in union FAMs
Bill Wendling via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 11 16:27:55 PDT 2022
void created this revision.
void added reviewers: kees, serge-sans-paille, rsmith, efriedma.
Herald added a project: All.
void requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Clang doesn't have the same behavior as GCC does with union flexible
array members. (Technically, union FAMs are probably not acceptable in
C99 and are an extension / accidentally supported "feature" of GCC and
Clang, but I digress.)
Both Clang and GCC treat *all* arrays at the end of a structure as FAMs.
GCC does the same with unions. Clang does it for some arrays in unions
(incomplete, '0', and '1'), but for all. Instead of having this
half-supported feature, sync Clang's behavior with GCC's.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D135727
Files:
clang/lib/AST/Expr.cpp
clang/test/CodeGen/bounds-checking-fam.c
clang/test/CodeGen/bounds-checking.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135727.466972.patch
Type: text/x-patch
Size: 8512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221011/cd24c5af/attachment-0001.bin>
More information about the cfe-commits
mailing list