]> granicus.if.org Git - clang/commit
[Coverage] Fix the start/end locations of switch statements
authorVedant Kumar <vsk@apple.com>
Fri, 4 Mar 2016 08:07:15 +0000 (08:07 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 4 Mar 2016 08:07:15 +0000 (08:07 +0000)
commitf377a655e7e305e24ee4bf8fa007e2d0558f96d9
treede92af980287bf2db4788dc660e47f7898516254
parentae13ed01cf32bf7f2135b308a00e170efbfbc1a2
[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
lib/CodeGen/CoverageMappingGen.cpp
test/CoverageMapping/switch.c
test/CoverageMapping/switchmacro.c