forked from OSchip/llvm-project
Fix integer unsigned behavior in clang due to signed left shift overflow.
llvm-svn: 162626
This commit is contained in:
parent
12cda3384a
commit
24adaee6bc
|
@ -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) {
|
||||
|
|
|
@ -886,7 +886,7 @@ void RTTIBuilder::BuildVMIClassTypeInfo(const CXXRecordDecl *RD) {
|
|||
Offset = Layout.getBaseClassOffset(BaseDecl);
|
||||
};
|
||||
|
||||
OffsetFlags = Offset.getQuantity() << 8;
|
||||
OffsetFlags = uint64_t(Offset.getQuantity()) << 8;
|
||||
|
||||
// The low-order byte of __offset_flags contains flags, as given by the
|
||||
// masks from the enumeration __offset_flags_masks.
|
||||
|
|
Loading…
Reference in New Issue