llvm-project/clang/lib/Format
Martin Probst c267292515 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
2022-01-28 12:37:45 +01:00
..
AffectedRangeManager.cpp [clang-format] Assert Line->First. NFC. 2022-01-24 08:54:55 +01:00
AffectedRangeManager.h
BreakableToken.cpp [clang-format] Move irrelevant code from getRangeLength to getRemainingLength. NFC. 2022-01-28 12:01:02 +01:00
BreakableToken.h [clang-format] Add option to control the spaces in a line comment 2021-02-01 22:48:50 +01:00
CMakeLists.txt [clang-format] Style to separate definition blocks 2022-01-03 15:47:39 -05:00
ContinuationIndenter.cpp [clang-format] Assert Line->First and State.NextToken->Previous. NFC. 2022-01-24 09:36:46 +01:00
ContinuationIndenter.h [clang-format] Add a BlockIndent option to AlignAfterOpenBracket 2022-01-17 09:03:23 +01:00
DefinitionBlockSeparator.cpp [clang-format] Fix SeparateDefinitionBlocks issues 2022-01-24 14:23:20 +00:00
DefinitionBlockSeparator.h [clang-format] Fix SeparateDefinitionBlocks issues 2022-01-24 14:23:20 +00:00
Encoding.h [clang-format][PR41964] Fix crash with SIGFPE when TabWidth is set to 0 and line starts with tab 2019-09-18 18:57:09 +00:00
Format.cpp [clang-format] Refactor: add FormatToken::hasWhitespaceBefore(). NFC. 2022-01-20 21:16:17 +01:00
FormatInternal.h Move clang/Tooling/Core/Lookup.h to clang/Tooling/Refactoring/Lookup.h 2020-10-20 10:13:28 +01:00
FormatToken.cpp [clang-format] Assert Line->First and State.NextToken->Previous. NFC. 2022-01-24 09:36:46 +01:00
FormatToken.h [clang-format] Fix AllowShortFunctionsOnASingleLine: InlineOnly with wrapping after record. 2022-01-27 18:06:31 +01:00
FormatTokenLexer.cpp [clang-format][NFC] Clean up tryMergeLessLess() 2022-01-20 14:35:07 -08:00
FormatTokenLexer.h [clang-format] Add more support for C# 8 nullables 2021-05-06 11:58:38 +02:00
MacroExpander.cpp [clang] Fix a few comment typos to cycle bots 2021-09-20 18:48:34 -04:00
Macros.h [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
NamespaceEndCommentsFixer.cpp [clang-format] Fix namespace end comments fixer with anonymous namespaces. 2022-01-14 11:41:14 +01:00
NamespaceEndCommentsFixer.h
QualifierAlignmentFixer.cpp [clang-format] Remove unused assignment. NFC. 2022-01-24 08:34:24 +01:00
QualifierAlignmentFixer.h [clang-format] Fix a crash (assertion) in qualifier alignment when matching template closer is null 2022-01-06 19:40:39 +00:00
SortJavaScriptImports.cpp clang-format: [JS] fix uninitialized memory. 2022-01-28 12:37:45 +01:00
SortJavaScriptImports.h
TokenAnalyzer.cpp [clang-format] Use range-for loops. NFC. 2022-01-07 16:06:11 +01:00
TokenAnalyzer.h Make clang-format fuzz through Lexing with asserts enabled. 2021-11-19 14:44:06 +01:00
TokenAnnotator.cpp [clang-format] Fix AllowShortFunctionsOnASingleLine: InlineOnly with wrapping after record. 2022-01-27 18:06:31 +01:00
TokenAnnotator.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
UnwrappedLineFormatter.cpp [clang-format] Fix AllowShortFunctionsOnASingleLine: InlineOnly with wrapping after record. 2022-01-27 18:06:31 +01:00
UnwrappedLineFormatter.h [clang-format] Fix the issue that empty lines being removed at the beginning of namespace 2021-06-27 15:59:21 +01:00
UnwrappedLineParser.cpp [clang-format] Fix AllowShortFunctionsOnASingleLine: InlineOnly with wrapping after record. 2022-01-27 18:06:31 +01:00
UnwrappedLineParser.h [llvm][ADT] Implement `BitVector::{pop_,}back` 2022-01-21 14:50:53 +01:00
UsingDeclarationsSorter.cpp [clang] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
UsingDeclarationsSorter.h
WhitespaceManager.cpp [clang-format] Fix incorrect alignment of operator= overloads. 2022-01-19 10:18:47 +01:00
WhitespaceManager.h [clang-format][NFC] Fix typo in comment 2022-01-05 17:33:16 +01:00