This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix undefined behavior: left shift of negative value
ClosedPublic

Authored by JDevlieghere on Apr 4 2022, 4:20 PM.

Details

Summary

Fix undefined behavior in AppleObjCRuntimeV2 where we were left shifting a signed value.

rdar://91242879

Diff Detail

Event Timeline

JDevlieghere created this revision.Apr 4 2022, 4:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2022, 4:20 PM
JDevlieghere requested review of this revision.Apr 4 2022, 4:20 PM
shafik added a subscriber: shafik.Apr 4 2022, 8:54 PM

Note, in C++20 this was made well-defined see godbolt the paper that did this was P0907R4 Signed Integers are Two’s Complement

jasonmolenda accepted this revision.Apr 4 2022, 9:05 PM

LGTM but unobfuscated is a uint64_t, does this cast do anything now?

This revision is now accepted and ready to land.Apr 4 2022, 9:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 9:37 AM