[PATCH] D98540: [M68k] Implement Disassembler
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 15 07:05:32 PDT 2021
RKSimon added inline comments.
================
Comment at: llvm/lib/Target/M68k/Disassembler/M68kDisassembler.cpp:448
+
+ Scratch = (Scratch << NumToRead) | Reader.readBits(NumToRead);
+}
----------------
@ricky26 coverity is warning that the NumToRead = 32 case results in UB when shifting Scratch.
Could this be:
```
Scratch = NumRead >= 32 ? 0 : (Scratch << NumToRead);
Scratch |= Reader.readBits(NumToRead);
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98540/new/
https://reviews.llvm.org/D98540
More information about the llvm-commits
mailing list