This is a follow up to https://reviews.llvm.org/D126864, addressing some remaining
comments.
It also considers union with a single zero-length array field as FAM for each
value of -fstrict-flex-arrays.
Paths
| Differential D132944
[clang] cleanup -fstrict-flex-arrays implementation ClosedPublic Authored by serge-sans-paille on Aug 30 2022, 7:53 AM.
Details
Summary This is a follow up to https://reviews.llvm.org/D126864, addressing some remaining It also considers union with a single zero-length array field as FAM for each
Diff Detail
Event Timeline
This revision is now accepted and ready to land.Aug 31 2022, 8:36 AM Closed by commit rGe0746a8a8d64: [clang] cleanup -fstrict-flex-arrays implementation (authored by serge-sans-paille). · Explain WhySep 1 2022, 6:10 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 457247 clang/include/clang/Driver/Options.td
clang/lib/CodeGen/CGExpr.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/bounds-checking-fam.c
clang/test/CodeGen/object-size-flex-array.c
|
This is a functional change (which is good, but the commit message needs to be adjusted). In current trunk
built with -fstrict-flex-arrays=2 -fsanitize=array-bounds would incorrectly report ubsan error, and this change fixes that.
I think this testcase can be added to clang/test/CodeGen/bounds-checking-fam.c. Probably this should also be nominated for backport to the 15.x branch (for the first point release I expect)