<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJztWttu2zgQ_RrlhYghUfcHPzhOjF0g2S2aortvBkVSMluJ8pJUmuzX75BybEuN07htgHThQJEtXmbOzBwO5ZGKlj1MvcTfHP6l58-8K-zll95sgWhNZHVetqohBp3XQnLthZc4ib1whjO8awqjAJrCCKO6Zh5e3BC6-hM-f5frzixEzfWErte9-H2hMAnBsFXbcPj41Ek4M34H57q-a87Xqv3EqYFLN8k2iwLOi34yXvy1EobrNaH8hkhSceXUhLPIz63ou1aw3gi4gmOrFI5ZLSr5of3M5S3_p-OSAoKMtlKbQzN6rbfmoYahiYfnqJMahHCGhDQvuV64eW6qta8Xe9uQuv4IZrbKC-cHdH9laN88X8FobuUFiRdeOdk58uKLL8Ks0AJBaA5Zc0AisW4BsRBYNm8lE0a0ktQanAOi-zEAsyZNwci3PPYN1ImT6FDHlzZeM625sgoRkLEfpcEYAd2TP_gXx7YLDho4WHaFfOSlczjQaOit1ajtEGu_NsQIuqREA6q5jYRVmY3mABPOoaOf-h4YIRRnvS7n0icVbSYJ6x3Tfu6t421p7cIpKgkwn0162r-7vprdXiHdFY0wiKCiq5Di61YZZFq0Mmat7XwMHFlUEL2umNC22ayErxeE0LoDIHiBiLT8onXHODIrjqgieoUKQj8bBcZs1N8aaECsa-zy6Jt86MrfqbZSpEFEVV3DpbEgXmfdw0IPfeTf-_CXllGZBYxx6kfonYKgOHwfLOBbICCpfwOzaiAMzuwi9vDMRqHv0ptF7rv_rexgJJuGmKOxMLcQvyEIDwSlLMEBMM3yf5N-7rNkmUTWCd39eSW7voNOdDsBSl_495GdYkmwlRmOZQZZgRQRmtv8V3TCua-yYs7534G5udhe4kkYwIV2kOHLZGKvHjTjaxv_Tor7vsGlTYsJPp3oCQXDYhuhYIckGiIp4izOESksD1-KxLDeD26WU5JZJelOSTxWkoLTK26WPe6l5pUl2_KO1N2LPQCxs_bXLWGNrijpVccu1Wc73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Kd-lGQ5i1JSljjJWEw54XnCWRqc1aTgtZ6CWz2MJf-CnAj4Dk4--3EEYop9DEeQBBH242yS-0UQ-GXEsJ_FAS28yOdAwnpi5UxaVZ2pqRNZdJWGzlpoo3edRLvMzB1gQGiEqfl0EGn3xgfX6MuKS1Ru0wa6vv54g4TRvC7PHMqpg_gfow2-mw>53880</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-format crashes when formatting LLVM itself
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          junaire
      </td>
    </tr>
</table>

<pre>
    ```
❯ clang-format -lines=265:282 -lines=341:342 lld/MachO/InputFiles.cpp
clang-format: /home/jun/dev/llvm-project/clang/lib/Format/WhitespaceManager.cpp:409: void clang::format::AlignTokenSequence(const clang::format::FormatStyle&, unsigned int, unsigned int, unsigned int, F&&, llvm::SmallVector<clang::format::WhitespaceManager::Change, 16>&) [with F = clang::format::WhitespaceManager::alignChainedConditionals()::<lambda(const clang::format::WhitespaceManager::Change&)>&]: Assertion `Changes[i].NewlinesBefore > 0 || Changes[i].Spaces >= static_cast<int>(Changes[i].Tok->SpacesRequiredBefore) || Changes[i].Tok->is(tok::eof)' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: clang-format -lines=265:282 -lines=341:342 lld/MachO/InputFiles.cpp
 #0 0x00007f4f81ddec04 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00007f4f81ddc32e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f4f817d6210 (/lib/x86_64-linux-gnu/libc.so.6+0x46210)
 #3 0x00007f4f817d618b raise /build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007f4f817b5859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007f4f817b5729 get_sysdep_segment_value /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007f4f817b5729 _nl_load_domain /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007f4f817c6f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x00007f4f82698adf void clang::format::AlignTokenSequence<clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&>(clang::format::FormatStyle const&, unsigned int, unsigned int, unsigned int, clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&, llvm::SmallVector<clang::format::WhitespaceManager::Change, 16u>&) (.isra.0) WhitespaceManager.cpp:0:0
 #9 0x00007f4f8269a7a2 unsigned int clang::format::AlignTokens<clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&>(clang::format::FormatStyle const&, clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&, llvm::SmallVector<clang::format::WhitespaceManager::Change, 16u>&, unsigned int, clang::format::FormatStyle::AlignConsecutiveStyle const&) WhitespaceManager.cpp:0:0
#10 0x00007f4f8269a731 unsigned int clang::format::AlignTokens<clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&>(clang::format::FormatStyle const&, clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&, llvm::SmallVector<clang::format::WhitespaceManager::Change, 16u>&, unsigned int, clang::format::FormatStyle::AlignConsecutiveStyle const&) WhitespaceManager.cpp:0:0
#11 0x00007f4f8269a731 unsigned int clang::format::AlignTokens<clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&>(clang::format::FormatStyle const&, clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&, llvm::SmallVector<clang::format::WhitespaceManager::Change, 16u>&, unsigned int, clang::format::FormatStyle::AlignConsecutiveStyle const&) WhitespaceManager.cpp:0:0
#12 0x00007f4f8269a731 unsigned int clang::format::AlignTokens<clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&>(clang::format::FormatStyle const&, clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&, llvm::SmallVector<clang::format::WhitespaceManager::Change, 16u>&, unsigned int, clang::format::FormatStyle::AlignConsecutiveStyle const&) WhitespaceManager.cpp:0:0
#13 0x00007f4f8269a731 unsigned int clang::format::AlignTokens<clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&>(clang::format::FormatStyle const&, clang::format::WhitespaceManager::alignChainedConditionals()::'lambda'(clang::format::WhitespaceManager::Change const&)&, llvm::SmallVector<clang::format::WhitespaceManager::Change, 16u>&, unsigned int, clang::format::FormatStyle::AlignConsecutiveStyle const&) WhitespaceManager.cpp:0:0
#14 0x00007f4f8269fcaf clang::format::WhitespaceManager::alignChainedConditionals() (/usr/local/bin/../lib/libclangFormat.so.15git+0xe7caf)
#15 0x00007f4f826a7944 clang::format::WhitespaceManager::generateReplacements() (/usr/local/bin/../lib/libclangFormat.so.15git+0xef944)
#16 0x00007f4f826280ce clang::format::(anonymous namespace)::Formatter::analyze(clang::format::TokenAnnotator&, llvm::SmallVectorImpl<clang::format::AnnotatedLine*>&, clang::format::FormatTokenLexer&) Format.cpp:0:0
#17 0x00007f4f82660f10 clang::format::TokenAnalyzer::process() (/usr/local/bin/../lib/libclangFormat.so.15git+0xa8f10)
#18 0x00007f4f826173a8 clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*)::'lambda5'(clang::format::Environment const&)::operator()(clang::format::Environment const&) const (.isra.0) Format.cpp:0:0
#19 0x00007f4f8261740c std::_Function_handler<std::pair<clang::tooling::Replacements, unsigned int> (clang::format::Environment const&), clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*)::'lambda5'(clang::format::Environment const&)>::_M_invoke(std::_Any_data const&, clang::format::Environment const&) Format.cpp:0:0
#20 0x00007f4f8262474b clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*) (/usr/local/bin/../lib/libclangFormat.so.15git+0x6c74b)
#21 0x00007f4f82625feb clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, clang::format::FormattingAttemptStatus*) (/usr/local/bin/../lib/libclangFormat.so.15git+0x6dfeb)
#22 0x000055d3fffbe579 clang::format::format(llvm::StringRef) ClangFormat.cpp:0:0
#23 0x000055d3fffc09a2 main (/usr/local/bin/clang-format+0x179a2)
#24 0x00007f4f817b70b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#25 0x000055d3fffb330e _start (/usr/local/bin/clang-format+0xa30e)
[1]    119524 abort (core dumped)  clang-format -lines=265:282 -lines=341:342 lld/MachO/InputFiles.cpp
```

Current commit:  94c28d289aec0ceb2b774152f405123076918095
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWltv2zYU_jXKCxFDou4PfnAcGxuQbEVTdHszKIqS2UqUR1K57NfvkHJsS40du22AdHCgyObl3D8e0kfKmvxp7ETu-nKvHXfizLCTXjuTOaIVEeVl0ciaaHRZccGU41_jKHT8CU7wtssPPOjyA4yqKnfw_JbQ5Z_w-btYtXrOK6ZGdLXq2O8yBSIE05ZNzeDjSyvg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