aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2024-03-27 13:59:35 -0700
committerGitHub <noreply@github.com>2024-03-27 13:59:35 -0700
commitc7d947f5e6c966bdba4db26097c3b433fcbe7841 (patch)
tree2cb4c2cb0177e93c5725e489aa9c73d9b21d3397 /clang/lib/CodeGen/CodeGenModule.cpp
parentf18600c87404eab8d0a279b0286f8add8b4a1bb8 (diff)
downloadllvm-c7d947f5e6c966bdba4db26097c3b433fcbe7841.zip
llvm-c7d947f5e6c966bdba4db26097c3b433fcbe7841.tar.gz
llvm-c7d947f5e6c966bdba4db26097c3b433fcbe7841.tar.bz2
[lldb] [ObjC runtime] Don't cast to signed when left shifting (#86605)
This is fixing a report from ubsan which I don't think is super high value, but our testsuite hits it on TestDataFormatterObjCNSContainer.py so I'd like to work around it. We are getting ``` runtime error: left shift of negative value -8827055269646171913 3159 int64_t data_payload_signed = 3160 ((int64_t)((int64_t)unobfuscated -> 3161 << m_objc_debug_taggedpointer_ext_payload_lshift) >> 3162 m_objc_debug_taggedpointer_ext_payload_rshift); ``` At this point `unobfuscated` is 0x85800000000000f7 and `m_objc_debug_taggedpointer_ext_payload_lshift` is 9, so `(int64_t)0x85800000000000f7<<9` shifts off the "sign" bit and then some zeroes etc, and that's how we get this error. We're only trying to extract some bits in the middle of the doubleword, so the fact that we're "losing" the sign is not a bug. Change the inner cast to (uint64_t).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions