From: Akira Hatanaka Date: Tue, 9 May 2017 01:54:51 +0000 (+0000) Subject: [Sema][ObjC] Clean up possible null dereference. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6d9512defc1f8cbaabf5036ddb8d8f8f3b6f451;p=clang [Sema][ObjC] Clean up possible null dereference. 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 --- diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index a44e9243e3..28581bad1a 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -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 =