aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2022-02-15 20:35:52 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2022-02-15 20:38:25 -0800
commit920146316da1e55017d46cfd62be783419da03d5 (patch)
tree038457d87fc44a7e4cf5373455b2d66227b17c46 /llvm/lib/Bitstream/Reader/BitstreamReader.cpp
parent1a5b881d4cf0fafe78258825f6442277e1636ecb (diff)
downloadllvm-920146316da1e55017d46cfd62be783419da03d5.zip
llvm-920146316da1e55017d46cfd62be783419da03d5.tar.gz
llvm-920146316da1e55017d46cfd62be783419da03d5.tar.bz2
[lldb] Don't rely on wrapping in PutRawBytes/PutBytesAsRawHex8
I was looking at Stream::PutRawBytes and thought I spotted a bug because both loops are using `i < src_len` as the loop condition despite them iterating in opposite directions. On closer inspection, the existing code is correct, because it relies on well-defined unsigned integer wrapping. Correct doesn't mean readable, so this patch changes the loop condition to compare against 0 when decrementing i while still covering the edge case of src_len potentially being 0 itself. Differential revision: https://reviews.llvm.org/D119857
Diffstat (limited to 'llvm/lib/Bitstream/Reader/BitstreamReader.cpp')
0 files changed, 0 insertions, 0 deletions