]> granicus.if.org Git - clang/commit
clang-format: Fix bug with ENAS_DontAlign and empty lines
authorJacob Bandes-Storch <jacob@bandes-stor.ch>
Thu, 10 Aug 2017 00:15:31 +0000 (00:15 +0000)
committerJacob Bandes-Storch <jacob@bandes-stor.ch>
Thu, 10 Aug 2017 00:15:31 +0000 (00:15 +0000)
commitbfca5df30168f318bab4dec75ac070d6f2ee5369
tree098c71198995ed9e3e2e00cb18cb43974fc1fd04
parenta34df13f82bd40f6f3c682defe88d5169ece7620
clang-format: Fix bug with ENAS_DontAlign and empty lines

This fixes a bug in `ENAS_DontAlign` (introduced in D32733) where blank lines had an EscapedNewlineColumn of 0, causing a subtraction to overflow when converted back to unsigned and leading to runaway memory allocation.

Differential Revision: https://reviews.llvm.org/D36019

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310539 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/WhitespaceManager.cpp
lib/Format/WhitespaceManager.h
unittests/Format/FormatTest.cpp