]> granicus.if.org Git - clang/commitdiff
[Sema][ObjC] Clean up possible null dereference.
authorAkira Hatanaka <ahatanaka@apple.com>
Tue, 9 May 2017 01:54:51 +0000 (01:54 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Tue, 9 May 2017 01:54:51 +0000 (01:54 +0000)
It appears that the code is actually dead since unbridged-cast
placeholder types are created by calling CastOperation::complete and
ImplicitCastExprs are never passed to it.

Spotted by Vedant Kumar.

rdar://problem/31542226

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302503 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprObjC.cpp

index a44e9243e3c52ca5a06230a04f366a880a91da94..28581bad1a7a4224a2d47d0522883283a7d9405a 100644 (file)
@@ -4241,8 +4241,7 @@ void Sema::diagnoseARCUnbridgedCast(Expr *e) {
     castType = cast->getTypeAsWritten();
     CCK = CCK_OtherCast;
   } else {
-    castType = cast->getType();
-    CCK = CCK_ImplicitConversion;
+    llvm_unreachable("Unexpected ImplicitCastExpr");
   }
 
   ARCConversionTypeClass castACTC =