================
@@ -1686,7 +1686,8 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore(
   DbgInstPtr DbgInst = unwrap(Builder)->insertDeclare(
       unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
       unwrap<DIExpression>(Expr), unwrap<DILocation>(DL),
-      unwrap<Instruction>(Instr));
+      Instr ? InsertPosition(unwrap<Instruction>(Instr)->getIterator())
+            : nullptr);
----------------
OCHyams wrote:

Wouldn't this trip an assertion in the `nullptr` InsertPosition case 
(`assert(InsertPt.isValid());` in `insertDbgVariableRecord` called by 
`insertDeclare`). Or am I reading this wrong? (Same question applies to the 
other calls below)

https://github.com/llvm/llvm-project/pull/126059
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to