llvm-bitcode
llvm-bitcode copied to clipboard
Prevent invalid VBRs from causing overflow
The "more" bit in a VBR chunk indicates that there are more chunks to parse, which are then shifted and added to the final value.
A valid VBR can represent at most a 64-bit number, but the bitstream reader currently does not stop shifting/adding as long as there is still a "more" bit on a chunk, which will cause integer overflow for excessively long VBRs.