Issue |
135819
|
Summary |
[clang-format] Segmentation fault when inserting enum trailing comma
|
Labels |
clang-format
|
Assignees |
|
Reporter |
sebmueller01
|
Running clang-format version `Ubuntu clang-format version 21.0.0` this can be reproduced using the below.
Code:
```cpp
enum class MyEnum_E {
MY_ENUM = 0U,
};
```
Style settings:
```
---
Language: Cpp
AllowShortEnumsOnASingleLine: false
EnumTrailingComma: Insert
```
clang-format crashes with a segmentation fault.
```
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVM.so.21.0 0x000075a27fc47b0f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63
1 libLLVM.so.21.0 0x000075a27fc45819 llvm::sys::RunSignalHandlers() + 89
2 libLLVM.so.21.0 0x000075a27fc4822d
3 libc.so.6 0x000075a27e445330
4 libclang-cpp.so.21.0 0x000075a28a19a704
5 libclang-cpp.so.21.0 0x000075a28a19a568
6 libclang-cpp.so.21.0 0x000075a28a1bcae6 clang::format::TokenAnalyzer::process(bool) + 1158
7 libclang-cpp.so.21.0 0x000075a28a19a3e7
8 libclang-cpp.so.21.0 0x000075a28a181d48 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*) + 3832
9 libclang-cpp.so.21.0 0x000075a28a182baf clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, clang::format::FormattingAttemptStatus*) + 79
10 clang-format 0x00005bbc6ce2d312
11 clang-format 0x00005bbc6ce2ac7a
12 libc.so.6 0x000075a27e42a1ca
13 libc.so.6 0x000075a27e42a28b __libc_start_main + 139
14 clang-format 0x00005bbc6ce27e35
Segmentation fault (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs