[PATCH] D62232: [Clang][Driver] recheck for nullptr

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 21 20:34:59 PDT 2019


nickdesaulniers created this revision.
nickdesaulniers added reviewers: rsmith, sfantao.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
47".

Looks like TC is checked for nullptr once, but not the second time.
Fixes r275645.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62232

Files:
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1821,7 +1821,8 @@
           else
             os << "host";
           os << " (";
-          os << TC->getTriple().normalize();
+          if (TC)
+            os << TC->getTriple().normalize();
 
           if (BoundArch)
             os << ":" << BoundArch;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62232.200635.patch
Type: text/x-patch
Size: 433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190522/7aca5e08/attachment.bin>


More information about the cfe-commits mailing list