[PATCH] D77342: Sema: check for null TInfo in ActOnBaseSpecifier

Luke Zarko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 2 16:17:55 PDT 2020


zarko created this revision.
zarko added a project: clang.
Herald added a subscriber: cfe-commits.
zarko added a reviewer: rsmith.

In certain cases (particularly when some input files are missing), GetTypeFromParser will set TInfo to nullptr in ActOnBaseSpecifier.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77342

Files:
  clang/lib/Sema/SemaDeclCXX.cpp


Index: clang/lib/Sema/SemaDeclCXX.cpp
===================================================================
--- clang/lib/Sema/SemaDeclCXX.cpp
+++ clang/lib/Sema/SemaDeclCXX.cpp
@@ -2581,6 +2581,8 @@
 
   TypeSourceInfo *TInfo = nullptr;
   GetTypeFromParser(basetype, &TInfo);
+  if (TInfo == nullptr)
+    return true;
 
   if (EllipsisLoc.isInvalid() &&
       DiagnoseUnexpandedParameterPack(SpecifierRange.getBegin(), TInfo,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77342.254637.patch
Type: text/x-patch
Size: 428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200402/ce375851/attachment.bin>


More information about the cfe-commits mailing list