[llvm] [RemoveDIs] Fix SIGSEGV caused by splitBasicBlock (PR #90312)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 00:49:00 PDT 2024


================
@@ -1009,7 +1009,7 @@ 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 *FirstMarker = createMarker(First);
----------------
OCHyams wrote:

Can you drop this into the `if (TrailingDbgRecords)` body? We don't want to create a marker if we're not going to use it when `TrailingDbgRecords` is false.

https://github.com/llvm/llvm-project/pull/90312


More information about the llvm-commits mailing list