[Bitstream] Make MaxChunkSize word-size independent
authorNikita Popov <npopov@redhat.com>
Tue, 8 Feb 2022 09:12:46 +0000 (10:12 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 8 Feb 2022 09:14:07 +0000 (10:14 +0100)
commitbf17cb294af422512b522575f3f74ab7964bf911
treea4e1974512b5cdb875ab48505167cba0cb3453f0
parent6d52ea885fb2d2c79fb1fa8062a92ab6c5adc734
[Bitstream] Make MaxChunkSize word-size independent

We only support chunks <= 32 bits regardless of whether we're
running on a 64-bit platform or not. Chunk size > 32 <= 64 would
cause UB in the reading code.
llvm/include/llvm/Bitstream/BitstreamReader.h
llvm/test/Bitcode/Inputs/invalid-chunk-size.bc [new file with mode: 0644]
llvm/test/Bitcode/invalid.test