Have Sema check for validity of CGString literal

instead of asserting in IRGen. Fixes radar 8390459.

llvm-svn: 113253
This commit is contained in:
Fariborz Jahanian
2010-09-07 19:38:13 +00:00
parent a74fa15f32
commit 56603ef7b2
5 changed files with 22 additions and 17 deletions

View File

@@ -1498,15 +1498,6 @@ GetConstantCFStringEntry(llvm::StringMap<llvm::Constant*> &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];