Depends on D77373.
Details
Diff Detail
- Repository
 - rG LLVM Github Monorepo
 
Event Timeline
| clang/test/CodeGen/bounds-checking.c | ||
|---|---|---|
| 116 | C version works even without patch  | |
| clang/lib/CodeGen/CGExpr.cpp | ||
|---|---|---|
| 882–887 | If we're going to further extend what Clang considers to be a flexible array access, we should do so consistently across our warning machinery and our sanitizers. Perhaps we could start by unifying this function with IsTailPaddedMemberArray in SemaChecking?  | |
| clang/lib/CodeGen/CGExpr.cpp | ||
|---|---|---|
| 882–887 | There is one place in external code which is blocking me from enabling this at Google. How much work it's going to be? To me these functions looks very different.  | |
| clang/lib/CodeGen/CGExpr.cpp | ||
|---|---|---|
| 882–887 | If you don't want to do the refactoring, please at least update Sema::CheckArrayAccess to skip over commas when looking for a member access in BaseExpr. Testcase: struct X { int a; int b[1]; } *p;
int n = (0, p->b)[3];... currently warns and trips the array-bounds sanitizer; with this change it would still warn but not trip the sanitizer, which seems bad. (Though I suppose the opposite case is worse.)  | |
If we're going to further extend what Clang considers to be a flexible array access, we should do so consistently across our warning machinery and our sanitizers. Perhaps we could start by unifying this function with IsTailPaddedMemberArray in SemaChecking?