[PATCH] D128248: [clang] Avoid an assertion in APValue::hasArrayFiller()
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 24 05:03:29 PDT 2022
aaron.ballman added inline comments.
================
Comment at: clang/include/clang/AST/APValue.h:511-512
bool hasArrayFiller() const {
+ if (!isArray())
+ return false;
return getArrayInitializedElts() != getArraySize();
----------------
I think this makes the interface somewhat self-inconsistent. `hasLValuePath()` asserts on `isLValue()`, and `getArraySize()` was providing a similar assertion (on `isArray()`) when called from `hasArrayFiller()`.
I take that to mean that the expectation for this interface is that the caller validates the `APValue` in the cases where it doesn't already know the answer.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128248/new/
https://reviews.llvm.org/D128248
More information about the cfe-commits
mailing list