diff options
author | Adrian Prantl <aprantl@apple.com> | 2022-08-09 10:34:57 -0700 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2022-08-09 10:34:57 -0700 |
commit | 68f97d2f787507eba56c667585fc31db3c27c469 (patch) | |
tree | 40a3c88b67f8bc36c2ff7d5e3be15d5f9ffab684 /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | |
parent | 926e7312b2f20f2f7b0a3d5ddbd29da5625507f3 (diff) | |
download | llvm-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.cpp | 2 |
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. |