[code-completion] Fix cache writer for non-decl kind

Thanks to Ben Barham for spotting this:
sizeof(~static_cast<uint8_t>(...)) is 4, but we need to write a single
byte here. Thankfully this code was probably not being hit in the
current caching scheme, which only caches declarations.

Looking at the history, this code was broken by d8fbaa01eb, which was
fixing an MSVC warning in this code. Unfortunately I do not have access
to the version of MSVC to check if there is still a warning here or for
what.
This commit is contained in:
Ben Langmuir
2020-09-29 09:41:13 -07:00
parent 3016a898bd
commit 28228eba49

View File

@@ -343,7 +343,7 @@ static void writeCachedModule(llvm::raw_ostream &out,
if (R->getKind() == CodeCompletionResult::Declaration)
LE.write(static_cast<uint8_t>(R->getAssociatedDeclKind()));
else
LE.write(~static_cast<uint8_t>(0u));
LE.write(static_cast<uint8_t>(~0u));
if (R->isOperator())
LE.write(static_cast<uint8_t>(R->getOperatorKind()));
else