This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6e7dd1e3e117: [clangd] Assert on varint encoding (authored
by kadircet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://
kadircet updated this revision to Diff 305108.
kadircet added a comment.
- Only assert on the 5th byte, prior bytes can have any value.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91405/new/
https://reviews.llvm.org/D91405
Files:
clang-tools-e
sammccall added inline comments.
Comment at: clang-tools-extra/clangd/index/Serialization.cpp:94
B = consume8();
+ assert((B & ~More) < (1 << (32 - Shift)) && "Invalid varint encoding");
Val |= (B & ~More) << Shift;
hmm, actually it's also inva
kadircet updated this revision to Diff 305094.
kadircet marked an inline comment as done.
kadircet added a comment.
- Increase width of `B` to prevent integer promotion.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91405/new/
https://reviews.llvm.
sammccall added inline comments.
Comment at: clang-tools-extra/clangd/index/Serialization.cpp:90
B = consume8();
+ assert((B & ~More) < (1 << (32 - Shift)) && "Invalid varint encoding");
Val |= (B & ~More) << Shift;
I'm fine with an assert, but
kadircet updated this revision to Diff 305055.
kadircet added a comment.
- Also fix the high byte
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91405/new/
https://reviews.llvm.org/D91405
Files:
clang-tools-extra/clangd/index/Serialization.cpp
kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, arphaman.
Herald added a project: clang.
kadircet requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.
5th byte of a varint can't be bigger than 0