[PATCH] D91405: [clangd] Assert on varint encoding

2020-11-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
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://

[PATCH] D91405: [clangd] Assert on varint encoding

2020-11-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
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

[PATCH] D91405: [clangd] Assert on varint encoding

2020-11-13 Thread Sam McCall via Phabricator via cfe-commits
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

[PATCH] D91405: [clangd] Assert on varint encoding

2020-11-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
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.

[PATCH] D91405: [clangd] Assert on varint encoding

2020-11-13 Thread Sam McCall via Phabricator via cfe-commits
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

[PATCH] D91405: [clangd] Assert on varint encoding

2020-11-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
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

[PATCH] D91405: [clangd] Assert on varint encoding

2020-11-13 Thread Kadir Cetinkaya via Phabricator via cfe-commits
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