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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 13 04:12:37 PST 2020


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 invalid to have the More bit set on the last byte...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91405/new/

https://reviews.llvm.org/D91405



More information about the cfe-commits mailing list