[PATCH] D158866: [StatepointLowering] Fix possible nullptr access in debug output

Danila Malyutin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 13:08:28 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe036ba50a764: [StatepointLowering] Fix possible nullptr access in debug output (authored by danilaml).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158866/new/

https://reviews.llvm.org/D158866

Files:
  llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp


Index: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -715,7 +715,8 @@
   assert((GFI || SI.Bases.empty()) &&
          "No gc specified, so cannot relocate pointers!");
 
-  LLVM_DEBUG(dbgs() << "Lowering statepoint " << *SI.StatepointInstr << "\n");
+  LLVM_DEBUG(if (SI.StatepointInstr) dbgs()
+             << "Lowering statepoint " << *SI.StatepointInstr << "\n");
 #ifndef NDEBUG
   for (const auto *Reloc : SI.GCRelocates)
     if (Reloc->getParent() == SI.StatepointInstr->getParent())
@@ -1156,6 +1157,7 @@
 
   // NB! The GC arguments are deliberately left empty.
 
+  LLVM_DEBUG(dbgs() << "Lowering call with deopt bundle " << *Call << "\n");
   if (SDValue ReturnVal = LowerAsSTATEPOINT(SI)) {
     ReturnVal = lowerRangeToAssertZExt(DAG, *Call, ReturnVal);
     setValue(Call, ReturnVal);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158866.553587.patch
Type: text/x-patch
Size: 993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230825/d3dd99d4/attachment.bin>


More information about the llvm-commits mailing list