From 7da71020b97c69b95831bd03d35e8e8404bfdea0 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 7 Sep 2010 19:38:13 +0000 Subject: Have Sema check for validity of CGString literal instead of asserting in IRGen. Fixes radar 8390459. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113253 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d125b370a0..6a527a229e 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1498,15 +1498,6 @@ GetConstantCFStringEntry(llvm::StringMap &Map, &ToPtr, ToPtr + NumBytes, strictConversion); - // Check for conversion failure. - if (Result != conversionOK) { - // FIXME: Have Sema::CheckObjCString() validate the UTF-8 string and remove - // this duplicate code. - assert(Result == sourceIllegal && "UTF-8 to UTF-16 conversion failed"); - StringLength = NumBytes; - return Map.GetOrCreateValue(String); - } - // ConvertUTF8toUTF16 returns the length in ToPtr. StringLength = ToPtr - &ToBuf[0]; -- cgit v1.2.3-18-g5258