clang-format 8.0 crashes with SIGFPE (floating point exception) when formatting following file:
app.cpp:
void a() {
//line starts with '\t'
}
$ clang-format -style='{TabWidth: 0}' app.cpp
Differential D67670
[clang-format][PR41964] Fix crash with SIGFPE when TabWidth is set to 0 and line starts with tab MyDeveloperDay on Sep 17 2019, 10:37 AM. Authored by
Details
clang-format 8.0 crashes with SIGFPE (floating point exception) when formatting following file: $ clang-format -style='{TabWidth: 0}' app.cpp
Diff Detail
Event Timeline
Comment Actions I should have known it was more involved. v % 0 and v / 0 are both undefined behavior |
Shouldn't that be (Style.TabWidth ? Column % Style.TabWidth)?
Otherwise can't that still crash when Column != 0 and TabWidth is 0?