diff options
author | Vedant Kumar <vsk@apple.com> | 2016-03-04 08:07:15 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-03-04 08:07:15 +0000 |
commit | 22bd871ea66538c1c21929828e2eca2185161c3e (patch) | |
tree | aa80b9bff2dd8548eedf07d0ceb148928f6b3c46 /clang/lib | |
parent | 37e594c79966900734dd1cc1bda3a9cafc48cd85 (diff) | |
download | bcm5719-llvm-22bd871ea66538c1c21929828e2eca2185161c3e.tar.gz bcm5719-llvm-22bd871ea66538c1c21929828e2eca2185161c3e.zip |
[Coverage] Fix the start/end locations of switch statements
While pushing switch statements onto the region stack we neglected to
specify their start/end locations. This results in a crash (PR26825) if
we end up in nested macro expansions without enough information to
handle the relevant file exits.
I added a test in switchmacro.c and fixed up a bunch of incorrect CHECK
lines that specify strange end locations for switches.
llvm-svn: 262697
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CoverageMappingGen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp index 9279d1a37cf..adafee43bf8 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -776,7 +776,7 @@ struct CounterCoverageMappingBuilder BreakContinueStack.back().ContinueCount, BC.ContinueCount); Counter ExitCount = getRegionCounter(S); - pushRegion(ExitCount); + pushRegion(ExitCount, getStart(S), getEnd(S)); } void VisitSwitchCase(const SwitchCase *S) { |