[PATCH] D61715: fix a null pointer deref issue

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 01:07:14 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL360317: Bugfix for nullptr check by klocwork (authored by pengfei, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61715?vs=198755&id=198773#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61715

Files:
  llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp


Index: llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
+++ llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
@@ -504,7 +504,8 @@
 
   if (!Res.empty())
     OS << Res << "," << Line;
-  if (auto *InlinedAt = DL->getInlinedAt()) {
+  auto *InlinedAt = DL ? DL->getInlinedAt() : nullptr;
+  if (InlinedAt) {
     if (DebugLoc InlinedAtDL = InlinedAt) {
       OS << " @[";
       printDebugLoc(InlinedAtDL, OS, Ctx);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61715.198773.patch
Type: text/x-patch
Size: 527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190509/c6bc8faf/attachment.bin>


More information about the llvm-commits mailing list