diff options
Diffstat (limited to 'include/clang/AST/VTableBuilder.h')
-rw-r--r-- | include/clang/AST/VTableBuilder.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/AST/VTableBuilder.h b/include/clang/AST/VTableBuilder.h index 392dad94a4a3..a6aa40b9d68b 100644 --- a/include/clang/AST/VTableBuilder.h +++ b/include/clang/AST/VTableBuilder.h @@ -147,9 +147,10 @@ private: assert((ComponentKind == CK_VCallOffset || ComponentKind == CK_VBaseOffset || ComponentKind == CK_OffsetToTop) && "Invalid component kind!"); - assert(Offset.getQuantity() <= ((1LL << 56) - 1) && "Offset is too big!"); + assert(Offset.getQuantity() < (1LL << 56) && "Offset is too big!"); + assert(Offset.getQuantity() >= -(1LL << 56) && "Offset is too small!"); - Value = ((Offset.getQuantity() << 3) | ComponentKind); + Value = (uint64_t(Offset.getQuantity()) << 3) | ComponentKind; } VTableComponent(Kind ComponentKind, uintptr_t Ptr) { |