[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-28 Thread Bill Wendling via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG463790bfc70e: [randstruct] Randomize all elements of a record (authored by void). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/unittests/AST/RandstructTest.cpp:368 +int h; +char name[0]; +} __attribute__((randomize_layout)); v

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-27 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 425595. void added a comment. Fix test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123958/new/ https://reviews.llvm.org/D123958 Files: clang/include/clang/AST/Decl.h clang/include/clang/AST/Randstruct.h

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-27 Thread Bill Wendling via Phabricator via cfe-commits
void added inline comments. Comment at: clang/lib/AST/Randstruct.cpp:201 +dyn_cast(RandomizedFields.back()->getType())) + if (CA->getSize().sle(2) || CA->isIncompleteArrayType()) +FlexibleArray = RandomizedFields.pop_back_val(); aaron.bal

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-27 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 425593. void marked 2 inline comments as done. void added a comment. Add a few more tests and remove a dead check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123958/new/ https://reviews.llvm.org/D123958 Files:

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Can you also add a test specifically for an enumeration declaration, as that was something we found bugs with? Comment at: clang/lib/AST/Randstruct.cpp:201 +dyn_cast(RandomizedFields.back()->getType())) + if (CA->getSize().sle(2)

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-26 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Gentle ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123958/new/ https://reviews.llvm.org/D123958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-20 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 424034. void added a comment. Correctly handle all types of Decls that can be found in a RecordDecl. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123958/new/ https://reviews.llvm.org/D123958 Files: clang/inclu

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-20 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D123958#3461714 , @aaron.ballman wrote: > In D123958#3461020 , @void wrote: > >> In D123958#3459205 , >> @aaron.ballman wrote: >> >>> I think yo

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D123958#3461020 , @void wrote: > In D123958#3459205 , @aaron.ballman > wrote: > >> I think you'll need a more targeted approach than assuming the only kinds of >> declarations i

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-19 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D123958#3459205 , @aaron.ballman wrote: > I think you'll need a more targeted approach than assuming the only kinds of > declarations in a struct are field-like in C. > > It seems that the issue you've got is with anonymous obje

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-19 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. In D123958#3459205 , @aaron.ballman wrote: > I had assumed that any structure not marked for randomization would not be > randomized. Based on that, I don't think inner structure objects (anonymous > or otherwise) should automatic

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think you'll need a more targeted approach than assuming the only kinds of declarations in a struct are field-like in C. It seems that the issue you've got is with anonymous objects in a structure where the inner fields are available for lookup in the outer stru

[PATCH] D123958: [randstruct] Randomize all elements of a record

2022-04-18 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added reviewers: aaron.ballman, MaskRay. Herald added a subscriber: StephenFan. Herald added a project: All. void requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. A record may have more than just FieldDecls i