aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2022-08-09 10:34:57 -0700
committerAdrian Prantl <aprantl@apple.com>2022-08-09 10:34:57 -0700
commit68f97d2f787507eba56c667585fc31db3c27c469 (patch)
tree40a3c88b67f8bc36c2ff7d5e3be15d5f9ffab684 /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
parent926e7312b2f20f2f7b0a3d5ddbd29da5625507f3 (diff)
downloadllvm-68f97d2f787507eba56c667585fc31db3c27c469.zip
llvm-68f97d2f787507eba56c667585fc31db3c27c469.tar.gz
llvm-68f97d2f787507eba56c667585fc31db3c27c469.tar.bz2
LiveDebugValues: Fix another crash related to unreachable blocks
This is a follow-up patch to D130999. In the test, the MIR contains an unreachable MBB but the code attempts to look it up in MLocs. This patch fixes this issue by checking for the default-constructed value. rdar://97226240 Differential Revision: https://reviews.llvm.org/D131453
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 968283e..aa3e7a3 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -297,6 +297,8 @@ public:
for (auto Location : MTracker->locations()) {
LocIdx Idx = Location.Idx;
ValueIDNum &VNum = MLocs[Idx.asU64()];
+ if (VNum == ValueIDNum::EmptyValue)
+ continue;
VarLocs.push_back(VNum);
// Is there a variable that wants a location for this value? If not, skip.