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.
This restores the original approach of a separate loop as originally proposed in https://reviews.llvm.org/D32733?vs=97397&id=97404, now with a proper justification :)
You could change this to:
unsigned Spaces = std::max<int>(1, EscapedNewlineColumn - PreviousEndOfTokenColumn - 1); for (unsigned i = 0; i < Newlines; ++i) { Text.append(Spaces, ' '); Text.append(UseCRLF ? "\\\r\n" : "\\\n"); Spaces = std::max<int>(0, EscapedNewlineColumn - 1); }And it should work without problems and without special code path.