<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 13, 2009, at 4:02 PM, Daniel Dunbar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Mon, Apr 13, 2009 at 12:46 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <div class="im"> On Apr 13, 2009, at 12:43 PM, Eli Friedman wrote:<br> > On Mon, Apr 13, 2009 at 12:08 PM, Steve Naroff <<a href="mailto:snaroff@apple.com">snaroff@apple.com</a>><br> > wrote:<br> >> Author: snaroff<br> >> Date: Mon Apr 13 14:08:08 2009<br> >> New Revision: 68975<br> >><br> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=68975&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=68975&view=rev</a><br> >> Log:<br> >> Fixed crasher in <<a href="rdar://problem/6780904">rdar://problem/6780904</a>> [irgen] Assertion failed:<br> >> (Result == conversionOK && "UTF-8 to UTF-16 conversion failed"),<br> >> function GetAddrOfConstantCFString, file CodeGenModule.cpp, line<br> >> 1063.<br> ><br> > We should not be letting invalid strings through Sema. Either the<br> > Lexer or Sema needs to deal with this; it needs to either error out or<br> > warn and "fix" the string to use a 0xFFFD.<br> ><br> > I would suggest reverting this fix because it does nothing but hide<br> > the issue.<br> <br> </div>Perhaps I don't understand the issue fully, but why is "\xff\xff"<br> necessarily a unicode string?</blockquote><div><br></div><div>I definitely don't understand the issue fully, but I agree with Eli's sentiment. If the string is supposed to be treated as unicode, but has errors, then it should be fixed in the AST and a warning (error) generated. If it isn't supposed to be treated as Unicode, then IRgen shouldn't try to convert it.</div> <div><br></div><div>In any case, IRgen should not have to deal with a conversion failure.</div><div><br></div></div></blockquote><div><br></div>I will change Sema to emit a warning for ObjC @-strings. C strings will not be effected.</div><div><br></div><div>In the meantime, the backend fix I made should work just fine (that is, gives us GCC behavior...rather than crash:-)</div><div><br></div><div>Is this o.k.?</div><div><br></div><div>snaroff</div><div><br><blockquote type="cite"><div class="gmail_quote"><div> - Daniel</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <font color="#888888"><br> -Chris<br> </font><div><div></div><div class="h5"><br> _______________________________________________<br> cfe-commits mailing list<br> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br> </div></div></blockquote></div><br> _______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></div><br></body></html>