Go to file
Etienne Bergeron 6feeb6554e [clang-tidy] Skip reporting of not applicable fixes.
Summary:
Invalid source location are causing clang-tidy to crash when manipulating an invalid file.

Macro definitions on the command line have locations in a virtual buffer and therefore
don't have a corresponding valid FilePath.

A recent patch added path conversion to absolute path. As the FilePath may now be empty,
the result of makeAbsolutePath may incorrectly be the folder WorkingDir.  The crash occurs
in getLocation which is not able to find the appropriate FileEntry (null pointer).

```
          SmallString<128> FixAbsoluteFilePath = Fix.getFilePath();
          Files.makeAbsolutePath(FixAbsoluteFilePath);
          FixLoc = getLocation(FixAbsoluteFilePath, Fix.getOffset());
```

With relative path, the code was not crashing because getLocation was skipping empty path.



Example of code:

```
int main() { return X; }
```

With the given command-line:

```
clang-tidy test.cc --checks=misc-macro-*  --  -DX=0+0
```

Reviewers: alexfh, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

Differential Revision: http://reviews.llvm.org/D18262

llvm-svn: 264073
2016-03-22 17:51:27 +00:00
clang StaticAnalyzer: Avoid an unintentional copy 2016-03-22 17:50:05 +00:00
clang-tools-extra [clang-tidy] Skip reporting of not applicable fixes. 2016-03-22 17:51:27 +00:00
compiler-rt [tsan] Disable randomized address space on linux aarch64. 2016-03-22 17:16:26 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc math: Fix ilogb(double) return type 2016-02-24 00:52:15 +00:00
libcxx Missing ATOMIC_*_LOCK_FREE tests 2016-03-18 17:48:58 +00:00
libcxxabi [libcxxabi] Disable cxa_thread_atexit_test if unavailable 2016-03-17 10:00:24 +00:00
libunwind [AArch64] Fix libunwind build when using GNU assembler 2016-02-11 21:22:57 +00:00
lld Appease MSVC bots by changing visibility of AtomVector. 2016-03-22 17:39:44 +00:00
lldb [LLDB]{MIPS] Fix TestPlatformProcessConnect.py 2016-03-22 08:08:02 +00:00
llgo [llgo] Roll gofrontend forward 2016-03-15 05:36:43 +00:00
llvm Add a hasOperandBundlesOtherThan helper, and use it; NFC 2016-03-22 17:51:25 +00:00
openmp [OMPT] Make tests require OMPT_BLAME 2016-03-22 08:23:24 +00:00
polly ScopInfo: Do not generate dependences for i1 values used in affine branches 2016-03-16 23:33:54 +00:00