This is an archive of the discontinued LLVM Phabricator instance.

[M68k] Avoid UB in disassembler
ClosedPublic

Authored by ricky26 on Sep 29 2021, 1:18 PM.

Details

Summary

When reading 32 bits a 32-bit shift would be executed.

This is undefined behaviour, but in this case we can just replace the
entire scratch value to avoid it.

Diff Detail

Event Timeline

ricky26 created this revision.Sep 29 2021, 1:18 PM
ricky26 requested review of this revision.Sep 29 2021, 1:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2021, 1:18 PM
myhsu accepted this revision.Sep 29 2021, 2:05 PM

LGTM Thank you!

This revision is now accepted and ready to land.Sep 29 2021, 2:05 PM
This revision was landed with ongoing or failed builds.Sep 29 2021, 2:12 PM
This revision was automatically updated to reflect the committed changes.