summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-06-23 21:36:31 +0000
committerpatrick <patrick@openbsd.org>2019-06-23 21:36:31 +0000
commit23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch)
treef7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/lib/CodeGen/SafeStackColoring.cpp
parentsort previous; ok deraadt (diff)
downloadwireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz
wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/CodeGen/SafeStackColoring.cpp')
-rw-r--r--gnu/llvm/lib/CodeGen/SafeStackColoring.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp b/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp
index 329458778a9..726c3800281 100644
--- a/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp
+++ b/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp
@@ -46,11 +46,10 @@ const StackColoring::LiveRange &StackColoring::getLiveRange(AllocaInst *AI) {
}
bool StackColoring::readMarker(Instruction *I, bool *IsStart) {
- auto *II = dyn_cast<IntrinsicInst>(I);
- if (!II || (II->getIntrinsicID() != Intrinsic::lifetime_start &&
- II->getIntrinsicID() != Intrinsic::lifetime_end))
+ if (!I->isLifetimeStartOrEnd())
return false;
+ auto *II = cast<IntrinsicInst>(I);
*IsStart = II->getIntrinsicID() == Intrinsic::lifetime_start;
return true;
}
@@ -172,7 +171,9 @@ void StackColoring::calculateLocalLiveness() {
BitVector LocalLiveIn;
for (auto *PredBB : predecessors(BB)) {
LivenessMap::const_iterator I = BlockLiveness.find(PredBB);
- assert(I != BlockLiveness.end() && "Predecessor not found");
+ // If a predecessor is unreachable, ignore it.
+ if (I == BlockLiveness.end())
+ continue;
LocalLiveIn |= I->second.LiveOut;
}