[clang] [clang] Follow-up fixes for offsetof unsigned index change (PR #207808)
Marlus Cadanus da Costa via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 8 07:04:48 PDT 2026
================
@@ -6824,7 +6824,7 @@ bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E,
CurrentType = AT->getElementType();
CharUnits ElementSize = S.getASTContext().getTypeSizeInChars(CurrentType);
int64_t ElemSize = ElementSize.getQuantity();
- if (Index != 0 && ElemSize > llvm::maxIntN(64) / Index) {
+ if ((Index != 0) && (ElemSize > (llvm::maxIntN(64) / Index))) {
----------------
marlus wrote:
Done, kept parentheses only around the division: llvm::maxIntN(64) / Index .
https://github.com/llvm/llvm-project/pull/207808
More information about the cfe-commits
mailing list