[WinEH] CatchHandler which don't have catch objects in StackColoring
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 8 Jan 2016 17:24:47 +0000 (17:24 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 8 Jan 2016 17:24:47 +0000 (17:24 +0000)
commitdc706797f99edce4335866facb9a3d8b95028201
tree1c5db8402443603726ed79792eca5b84672ec07e
parent44f8ddb3bba1e15c8a68b10f07d58abbe8c6bdaa
[WinEH] CatchHandler which don't have catch objects in StackColoring

StackColoring rewrites the frame indicies of operations involving
allocas if it can find that the life time of two objects do not overlap.
MSVC EH needs to be kept aware of this if happens in the event that a
catch object has moved around.  However, we represent the non-existance
of a catch object with a sentinel frame index (INT_MAX).  This sentinel
also happens to be the EmptyKey of the SlotRemap DenseMap.  Testing for
whether or not we need to translate the frame index fails in this case
because we call the count method on the DenseMap with the EmptyKey,
leading to assertions.  Instead, check if it is our sentinel value
before trying to look into the DenseMap.

This fixes PR26073.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257182 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/StackColoring.cpp
test/CodeGen/X86/catchpad-lifetime.ll