forked from OSchip/llvm-project
[lldb] Fix undefined behavior: left shift of negative value
Fix undefined behavior in AppleObjCRuntimeV2 where we were left shifting a signed value. This also removes redundant casts of unobfuscated to uint64_t which it already is. rdar://91242879 Differential revision: https://reviews.llvm.org/D123098
This commit is contained in:
parent
a3d5f1cf5d
commit
73714a3c60
|
@ -2762,11 +2762,10 @@ AppleObjCRuntimeV2::TaggedPointerVendorRuntimeAssisted::GetClassDescriptor(
|
|||
}
|
||||
|
||||
uint64_t data_payload =
|
||||
(((uint64_t)unobfuscated << m_objc_debug_taggedpointer_payload_lshift) >>
|
||||
((unobfuscated << m_objc_debug_taggedpointer_payload_lshift) >>
|
||||
m_objc_debug_taggedpointer_payload_rshift);
|
||||
int64_t data_payload_signed =
|
||||
((int64_t)((int64_t)unobfuscated
|
||||
<< m_objc_debug_taggedpointer_payload_lshift) >>
|
||||
((int64_t)(unobfuscated << m_objc_debug_taggedpointer_payload_lshift) >>
|
||||
m_objc_debug_taggedpointer_payload_rshift);
|
||||
return ClassDescriptorSP(new ClassDescriptorV2Tagged(
|
||||
actual_class_descriptor_sp, data_payload, data_payload_signed));
|
||||
|
|
Loading…
Reference in New Issue