[PATCH] D92140: Fix noderef for array member of deref expr

2020-12-07 Thread Jann Horn via Phabricator via cfe-commits
thejh added a comment. Thanks! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92140/new/ https://reviews.llvm.org/D92140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D92140: Fix noderef for array member of deref expr

2020-12-01 Thread Jann Horn via Phabricator via cfe-commits
thejh added a comment. @leonardchan I don't have commit access; can you land this change and D92141 for me? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92140/new/ https://reviews.llvm.org/D92140 __

[PATCH] D92141: Fix noderef for AddrOf on MemberExpr

2020-11-25 Thread Jann Horn via Phabricator via cfe-commits
thejh marked an inline comment as done. thejh added inline comments. Comment at: clang/test/Frontend/noderef.c:75-76 + // enclosing AddrOf. + p = &s->a;// ok + p = &(*s).a; // ok + p2 = &s->a; // expected-warning{{casting to dereferenceable pointer removes 'noderef' a

[PATCH] D92141: Fix noderef for AddrOf on MemberExpr

2020-11-25 Thread Jann Horn via Phabricator via cfe-commits
thejh updated this revision to Diff 307728. thejh added a comment. Removed duplicate tests as suggested by leonardchan Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92141/new/ https://reviews.llvm.org/D92141 Files: clang/lib/Sema/SemaExprMember.

[PATCH] D92141: Fix noderef for AddrOf on MemberExpr

2020-11-25 Thread Jann Horn via Phabricator via cfe-commits
thejh added a comment. (I marked this as depending on D92140 because if you apply this patch to the current HEAD directly, the tests will break.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92141/new/ https://re

[PATCH] D92141: Fix noderef for AddrOf on MemberExpr

2020-11-25 Thread Jann Horn via Phabricator via cfe-commits
thejh created this revision. thejh added reviewers: leonardchan, aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. thejh requested review of this revision. As part of this change, one existing test case has to be adjusted because it accidentally stripped the NoD

[PATCH] D92140: Fix noderef for array member of deref expr

2020-11-25 Thread Jann Horn via Phabricator via cfe-commits
thejh created this revision. thejh added reviewers: leonardchan, aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. thejh requested review of this revision. Given an __attribute__((noderef)) pointer "p" to the struct struct s { int a[2]; }; ensure that the fo

[PATCH] D91828: [Sema/Attribute] Ignore noderef attribute in unevaluated context

2020-11-23 Thread Jann Horn via Phabricator via cfe-commits
thejh added a comment. In D91828#2411207 , @aaron.ballman wrote: > In D91828#2411203 , @thejh wrote: > >> @aaron.ballman Can you land it for me? I don't have commit access. > > Happy to do so -- are you okay with "

[PATCH] D91828: [Sema/Attribute] Ignore noderef attribute in unevaluated context

2020-11-23 Thread Jann Horn via Phabricator via cfe-commits
thejh added a comment. @aaron.ballman Can you land it for me? I don't have commit access. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91828/new/ https://reviews.llvm.org/D91828 ___ cfe-commits mailing

[PATCH] D91828: [Sema/Attribute] Ignore noderef attribute in unevaluated context

2020-11-20 Thread Jann Horn via Phabricator via cfe-commits
thejh added inline comments. Comment at: clang/test/Frontend/noderef.c:71 + x = sizeof(s->a + (s->b)); // ok + // Nested struct access aaron.ballman wrote: > Can you add tests for the weird situations where the expression actually is > evaluated? e.g., > ```

[PATCH] D91828: [Sema/Attribute] Ignore noderef attribute in unevaluated context

2020-11-20 Thread Jann Horn via Phabricator via cfe-commits
thejh updated this revision to Diff 306792. thejh marked an inline comment as done. thejh added a comment. As requested by @aaron.ballman, added tests for edgecases where sizeof()/typeid() can cause memory access. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D91828: [Sema/Attribute] Ignore noderef attribute in unevaluated context

2020-11-19 Thread Jann Horn via Phabricator via cfe-commits
thejh updated this revision to Diff 306555. thejh added a comment. re-uploading to trigger a new build, since the build error looks unrelated. maybe current trunk is flaky? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91828/new/ https://reviews.ll

[PATCH] D91828: [Sema/Attribute] Ignore noderef attribute in unevaluated context

2020-11-19 Thread Jann Horn via Phabricator via cfe-commits
thejh created this revision. thejh added reviewers: leonardchan, rsmith, aaron.ballman, mcgrathr. Herald added a project: clang. Herald added a subscriber: cfe-commits. thejh requested review of this revision. The noderef attribute is for catching code that accesses pointers in a different address