aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorFranklin Zhang <zhangfenglei@huawei.com>2024-05-01 12:45:11 +0800
committerGitHub <noreply@github.com>2024-05-01 13:45:11 +0900
commit0fb50371a108d27394bb76adf8cffe944ab904cd (patch)
treef5fb44a0a7d7894145bf94cb90b9f2bc28b093fa /llvm/lib
parentbafc5f42c0132171287d7cba7f5c14459be1f7b7 (diff)
downloadllvm-0fb50371a108d27394bb76adf8cffe944ab904cd.zip
llvm-0fb50371a108d27394bb76adf8cffe944ab904cd.tar.gz
llvm-0fb50371a108d27394bb76adf8cffe944ab904cd.tar.bz2
[RemoveDIs] Fix SIGSEGV caused by splitBasicBlock (#90312)
See `llvm/unittests/IR/BasicBlockDbgInfoTest.cpp` for a test case.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 42279f80..29f2cbf 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -1009,9 +1009,9 @@ void BasicBlock::spliceDebugInfoImpl(BasicBlock::iterator Dest, BasicBlock *Src,
// generate the iterator with begin() / getFirstInsertionPt(), it means
// any trailing debug-info at the end of the block would "normally" have
// been pushed in front of "First". Move it there now.
- DbgMarker *FirstMarker = getMarker(First);
DbgMarker *TrailingDbgRecords = getTrailingDbgRecords();
if (TrailingDbgRecords) {
+ DbgMarker *FirstMarker = createMarker(First);
FirstMarker->absorbDebugValues(*TrailingDbgRecords, true);
TrailingDbgRecords->eraseFromParent();
deleteTrailingDbgRecords();