This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Fix left-/right-shifting more than sizeof(unsigned)
ClosedPublic

Authored by tbaeder on Jan 2 2023, 7:38 AM.

Details

Summary
We were just casting to `unsigned` before, so that caused problems when
shifting more bits than `unsigned` has.

Diff Detail

Event Timeline

tbaeder created this revision.Jan 2 2023, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 2 2023, 7:38 AM
tbaeder requested review of this revision.Jan 2 2023, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 2 2023, 7:38 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Jan 3 2023, 7:04 AM
This revision is now accepted and ready to land.Jan 3 2023, 7:04 AM
shafik added inline comments.Jan 23 2023, 9:21 PM
clang/test/AST/Interp/shifts.cpp
149

Can we add a test for left shift as well.

tbaeder updated this revision to Diff 491633.Jan 24 2023, 12:29 AM
tbaeder marked an inline comment as done.
This revision was landed with ongoing or failed builds.Jan 25 2023, 10:07 PM
This revision was automatically updated to reflect the committed changes.