[clang] [clang-format][NFC] Clean up fillRanges() in ClangFormat.cpp (PR #143236)

Jorge Gorbe Moya via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 9 14:41:19 PDT 2025


slackito wrote:

It seems this change has introduced a bug when formatting multiple files in one go. Passing a shorter file after a longer one results in a stale length being used. It can be reproduced with trivially short files:

```
$ cat ~/a.cc

$ cat ~/b.cc
// a
$ bin/clang-format ~/b.cc ~/a.cc
// a
error: invalid length 5, offset + length (5) is outside the file.
```

This was supposed to be an NFC change so I'm going to revert the patch while the problem gets investigated/fixed.

https://github.com/llvm/llvm-project/pull/143236


More information about the cfe-commits mailing list