Skip to content
Commit c2672925 authored by Martin Probst's avatar Martin Probst
Browse files

clang-format: [JS] fix uninitialized memory.

SortJavaScriptImports attempts to set its currently parsed token to an
invalid token when it reaches the end of the line. However in doing so,
it used a `FormatToken`, which contains a `Token Tok`. `Token` does not
have a constructor, so its fields start out as uninitialized memory.

`Token::startToken()` initializes all fields. Calling it in
`JavaScriptImportSorter`'s constructor thus fixes the problem.

Differential Revision: https://reviews.llvm.org/D118448
parent cd79ca61
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment