digitalmars.D.bugs - toUTF8 seg-v on bad input
- BCS (3/3) Apr 08 2007 If std.utf.toUTF8(dchar[]) is given bad input it sometimes seg-v's. DMD ...
- Thomas Kuehne (12/15) Apr 22 2007 -----BEGIN PGP SIGNED MESSAGE-----
- BCS (5/28) Apr 23 2007 That may well have been the case, I was dealing with UTF convention code...
If std.utf.toUTF8(dchar[]) is given bad input it sometimes seg-v's. DMD also seg-v's if the same input undergoes a dchar[] -> char[] translation at compile time. I'll post a string that does it when I find another case.
Apr 08 2007
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 BCS schrieb am 2007-04-08:If std.utf.toUTF8(dchar[]) is given bad input it sometimes seg-v's. DMD also seg-v's if the same input undergoes a dchar[] -> char[] translation at compile time. I'll post a string that does it when I find another case.Are you sure that toUTF8(char[]) segfaulted? The only case I see would be elements with values above 0x10FFFF, though you should file a bug for that case because Phobos uses "assert(0)" instead of "throw ...". Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFGK81ELK5blCcjpWoRAhxZAJ92nt6H2ZIwwgVQk3OdziQXAzCqjQCfZe34 MdcZXk3amyspA9M5ylW1TOQ= =MFzd -----END PGP SIGNATURE-----
Apr 22 2007
Thomas Kuehne wrote:-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 BCS schrieb am 2007-04-08:That may well have been the case, I was dealing with UTF convention code what I started seeing the error. What I would rely like to see is a cantFailToUTF8 function that will give you something no matter what it is given. It would be handy for debug output.If std.utf.toUTF8(dchar[]) is given bad input it sometimes seg-v's. DMD also seg-v's if the same input undergoes a dchar[] -> char[] translation at compile time. I'll post a string that does it when I find another case.Are you sure that toUTF8(char[]) segfaulted? The only case I see would be elements with values above 0x10FFFF, though you should file a bug for that case because Phobos uses "assert(0)" instead of "throw ...". Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFGK81ELK5blCcjpWoRAhxZAJ92nt6H2ZIwwgVQk3OdziQXAzCqjQCfZe34 MdcZXk3amyspA9M5ylW1TOQ= =MFzd -----END PGP SIGNATURE-----
Apr 23 2007