[PATCH] D77374: Fix -fsanitize=array-bounds with comma operator
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 8 19:01:19 PDT 2020
rsmith added inline comments.
================
Comment at: clang/lib/CodeGen/CGExpr.cpp:882-887
+ while (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E)) {
+ if (!BO->isCommaOp())
+ break;
+ E = BO->getRHS();
+ E = E->IgnoreParens();
+ }
----------------
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`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77374/new/
https://reviews.llvm.org/D77374
More information about the cfe-commits
mailing list