https://bugs.llvm.org/show_bug.cgi?id=50663
Bug ID: 50663
Summary: [clang-format] Crash with Whitesmiths and labels in
top-level block
Product: clang
Version: 12.0
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Formatter
Assignee: unassignedclangb...@nondot.org
Reporter: oliver....@outlook.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org
Created attachment 24941
--> https://bugs.llvm.org/attachment.cgi?id=24941&action=edit
Zipped goto.cpp and switch.cpp files
Formatting a file with a label within a top-level block causes clang-format to
hang for an extended period of time and use a lot of memory. It then proceeds
to crash:
PS C:\Users\olive\clang-format-repro> clang-format.exe
--style='{BreakBeforeBraces: Whitesmiths}' goto.cpp
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0. Program arguments: "C:\\Program Files\\LLVM\\bin\\clang-format.exe"
"--style={BreakBeforeBraces: Whitesmiths}" goto.cpp
PS C:\Users\olive\clang-format-repro> cat goto.cpp
int main() {
test:
return 0;
}
No actual backtrace is printed.
I have prepared test cases with both a simple function and a switch statement
and both lead to a crash.
My suspicion is that this was caused by the patch that tried to fix case labels
with Whitesmiths [1]. This bug does not occur with version 11.0 of
clang-format.
[1] https://reviews.llvm.org/D94500
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs