Skip to content

Commit 28228eb

Browse files
committed
[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 d8fbaa0, 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.
1 parent 3016a89 commit 28228eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/IDE/CodeCompletionCache.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static void writeCachedModule(llvm::raw_ostream &out,
343343
if (R->getKind() == CodeCompletionResult::Declaration)
344344
LE.write(static_cast<uint8_t>(R->getAssociatedDeclKind()));
345345
else
346-
LE.write(~static_cast<uint8_t>(0u));
346+
LE.write(static_cast<uint8_t>(~0u));
347347
if (R->isOperator())
348348
LE.write(static_cast<uint8_t>(R->getOperatorKind()));
349349
else

0 commit comments

Comments
 (0)