[PATCH] D67670: [clang-format][PR41964] Fix crash with SIGFPE when TabWidth is set to 0 and line starts with tab
MyDeveloperDay via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 17 12:21:19 PDT 2019
MyDeveloperDay marked an inline comment as done.
MyDeveloperDay added inline comments.
================
Comment at: clang/lib/Format/FormatTokenLexer.cpp:660
case '\t':
- Column += Style.TabWidth - Column % Style.TabWidth;
+ Column += Style.TabWidth - (Column ? Column % Style.TabWidth : 0);
break;
----------------
klimek wrote:
> Shouldn't that be (Style.TabWidth ? Column % Style.TabWidth)?
> Otherwise can't that still crash when Column != 0 and TabWidth is 0?
let me add some tests...
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67670/new/
https://reviews.llvm.org/D67670
More information about the cfe-commits
mailing list