<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56287>56287</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format crash with AlignArrayOfStructures
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nolange
</td>
</tr>
</table>
<pre>
happens on debian bookworm x86_64 with clang-format-14 1:14.0.5-1
Reproducer is attached
```
Stack dump:
0. Program arguments: clang-format "--style={BasedOnStyle: LLVM, AlignArrayOfStructures: Left}" log_data.c
#0 0x00007f0ad80a23a1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xea23a1)
#1 0x00007f0ad80a00fe llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xea00fe)
#2 0x00007f0ad80a28d6 (/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xea28d6)
#3 0x00007f0ae145c200 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12200)
#4 0x00007f0ae08a4023 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2ca4023)
#5 0x00007f0ae08a3ac7 clang::format::WhitespaceManager::alignArrayInitializersLeftJustified(clang::format::WhitespaceManager::CellDescriptions&&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2ca3ac7)
#6 0x00007f0ae08a2596 clang::format::WhitespaceManager::alignArrayInitializers(unsigned int, unsigned int) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2ca2596)
#7 0x00007f0ae089f526 clang::format::WhitespaceManager::generateReplacements() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2c9f526)
#8 0x00007f0ae084ce8d (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2c4ce8d)
#9 0x00007f0ae0875526 clang::format::TokenAnalyzer::process() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2c75526)
#10 0x00007f0ae0859d51 (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2c59d51)
#11 0x00007f0ae0844dcb 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/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2c44dcb)
#12 0x00007f0ae0845ba1 clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, clang::format::FormattingAttemptStatus*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2c45ba1)
#13 0x000000000040b619 (/usr/lib/llvm-14/bin/clang-format+0x40b619)
#14 0x0000000000409825 (/usr/lib/llvm-14/bin/clang-format+0x409825)
#15 0x00007f0ad6c4a7fd __libc_start_main ./csu/../csu/libc-start.c:332:16
#16 0x000000000040696a (/usr/lib/llvm-14/bin/clang-format+0x40696a)
zsh: segmentation fault (core dumped) clang-format --style='{BasedOnStyle: LLVM, AlignArrayOfStructures: Left}'
```
[log_data.zip](https://github.com/llvm/llvm-project/files/9012485/log_data.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNV8tu4zYU_Rp5Q1igqPfCCycZoy0ymEEyaJcGJVIyG5kSSKp5fH0vKSc2XTudjGcxhiFIJHXOuYePe1X17HmxocPApUa9RIxXgkpU9f3DY6-26KnI1lmCHoXZoLqjsp030EzNPEpQFMTLKAlxmM6jAN8EeDld7_igejbWXCGhETWG1hvODkcEGd793eM9jHhAbNwOgDg14TDA5VfVt4puEVXtuOXSaOj2VKCAkPlcm-eOB_FNkF9dUc3ZF3k_tSzR7e2fnwNyjZadaOVSKfr8pbk3aqzNqLiDu-WNCfIbAEJd364ZNTSsJw2AHmOEnzD88gZTVmBKYh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