[sancov] Don't instrument blocks with no insertion point
authorReid Kleckner <rnk@google.com>
Thu, 23 Mar 2017 23:30:41 +0000 (23:30 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 23 Mar 2017 23:30:41 +0000 (23:30 +0000)
commit392f0626754d9ebf07bb2bdb3b6b04f12feb5025
tree6b6b43bec1c05711f3d9352487535f8d060940b5
parentb197d5b0a00747c0b6d8f82a275f871f3c9240c2
[sancov] Don't instrument blocks with no insertion point

This prevents crashes when attempting to instrument functions containing
C++ try.

Sanitizer coverage will still fail at runtime when an exception is
thrown through a sancov instrumented function, but that seems marginally
better than what we have now. The full solution is to color the blocks
in LLVM IR and only instrument blocks that have an unambiguous color,
using the appropriate token.

llvm-svn: 298662
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/SanitizerCoverage/wineh.ll [new file with mode: 0644]