aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CoverageMappingGen.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-06-23 20:29:09 +0000
committerJustin Bogner <mail@justinbogner.com>2015-06-23 20:29:09 +0000
commite44dd6dbd06814e0d8d6b1497fb681c00fe8f2dc (patch)
tree318c4ee8d3d7c7d969ee9453d8b6f8a6fba21977 /clang/lib/CodeGen/CoverageMappingGen.cpp
parentc917a381f8fbfb0971d4012dbf9315e9c19b6335 (diff)
downloadllvm-e44dd6dbd06814e0d8d6b1497fb681c00fe8f2dc.zip
llvm-e44dd6dbd06814e0d8d6b1497fb681c00fe8f2dc.tar.gz
llvm-e44dd6dbd06814e0d8d6b1497fb681c00fe8f2dc.tar.bz2
InstrProf: Fix a crash when an implicit def appears in a macro
llvm-svn: 240452
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index 9ad5d14..d8a9460 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -475,7 +475,8 @@ struct CounterCoverageMappingBuilder
/// files, this adjusts our current region stack and creates the file regions
/// for the exited file.
void handleFileExit(SourceLocation NewLoc) {
- if (SM.isWrittenInSameFile(MostRecentLocation, NewLoc))
+ if (NewLoc.isInvalid() ||
+ SM.isWrittenInSameFile(MostRecentLocation, NewLoc))
return;
// If NewLoc is not in a file that contains MostRecentLocation, walk up to