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 | f377a655e7e305e24ee4bf8fa007e2d0558f96d9 (patch) | |
tree | de92af980287bf2db4788dc660e47f7898516254 /lib/CodeGen/CoverageMappingGen.cpp | |
parent | ae13ed01cf32bf7f2135b308a00e170efbfbc1a2 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r-- | lib/CodeGen/CoverageMappingGen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CoverageMappingGen.cpp b/lib/CodeGen/CoverageMappingGen.cpp index 9279d1a37c..adafee43bf 100644 --- a/lib/CodeGen/CoverageMappingGen.cpp +++ b/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) { |