Runtime: More robust NSStringToString_slow.
Runtime: More robust NSStringToString_slow.

It still leaks malloced buffers, but it should now work with any NSString subclass, and it won't fail if the UTF-8 byte length is more than twice the surrogate-pair length.

Swift SVN r3921

jtbandes/swift,karwa/swift,alblue/swift,milseman/swift,felix91gr/swift,hooman/swift,dduan/swift,therealbnut/swift,swiftix/swift.old,swiftix/swift.old,arvedviehweger/swift,ben-ng/swift,rudkx/swift,zisko/swift,modocache/swift,ben-ng/swift,karwa/swift,sschiau/swift,tjw/swift,karwa/swift,bitjammer/swift,therealbnut/swift,aschwaighofer/swift,Jnosh/swift,swiftix/swift.old,uasys/swift,JGiola/swift,glessard/swift,bitjammer/swift,arvedviehweger/swift,codestergit/swift,glessard/swift,huonw/swift,roambotics/swift,lorentey/swift,ahoppen/swift,atrick/swift,sdulal/swift,johnno1962d/swift,nathawes/swift,russbishop/swift,tinysun212/swift-windows,huonw/swift,kentya6/swift,jmgc/swift,huonw/swift,huonw/swift,sschiau/swift,sdulal/swift,shahmishal/swift,frootloops/swift,Ivacker/swift,jopamer/swift,kentya6/swift,gmilos/swift,kstaring/swift,JGiola/swift,jopamer/swift,kusl/swift,jckarter/swift,mightydeveloper/swift,milseman/swift,parkera/swift,mightydeveloper/swift,austinzheng/swift,KrishMunot/swift,stephentyrone/swift,emilstahl/swift,shajrawi/swift,mightydeveloper/swift,xedin/swift,sschiau/swift,ahoppen/swift,apple/swift,shahmishal/swift,austinzheng/swift,airspeedswift/swift,kperryua/swift,milseman/swift,austinzheng/swift,MukeshKumarS/Swift,KrishMunot/swift,amraboelela/swift,tjw/swift,johnno1962d/swift,devincoughlin/swift,CodaFi/swift,arvedviehweger/swift,kperryua/swift,harlanhaskins/swift,slavapestov/swift,austinzheng/swift,aschwaighofer/swift,calebd/swift,lorentey/swift,calebd/swift,gribozavr/swift,emilstahl/swift,benlangmuir/swift,hughbe/swift,gottesmm/swift,airspeedswift/swift,hooman/swift,amraboelela/swift,jmgc/swift,Jnosh/swift,tardieu/swift,manavgabhawala/swift,austinzheng/swift,swiftix/swift.old,CodaFi/swift,tardieu/swift,lorentey/swift,slavapestov/swift,sschiau/swift,tjw/swift,airspeedswift/swift,hughbe/swift,KrishMunot/swift,lorentey/swift,Ivacker/swift,adrfer/swift,tinysun212/swift-windows,djwbrown/swift,kstaring/swift,ahoppen/swift,khizkhiz/swift,russbishop/swift,return/swift,dduan/swift,kentya6/swift,frootloops/swift,kusl/swift,russbishop/swift,gottesmm/swift,deyton/swift,natecook1000/swift,shahmishal/swift,therealbnut/swift,frootloops/swift,adrfer/swift,uasys/swift,xedin/swift,devincoughlin/swift,IngmarStein/swift,tardieu/swift,practicalswift/swift,uasys/swift,deyton/swift,dreamsxin/swift,karwa/swift,kstaring/swift,hughbe/swift,nathawes/swift,devincoughlin/swift,amraboelela/swift,calebd/swift,lorentey/swift,hooman/swift,dduan/swift,apple/swift,amraboelela/swift,LeoShimonaka/swift,shahmishal/swift,johnno1962d/swift,LeoShimonaka/swift,shajrawi/swift,tardieu/swift,manavgabhawala/swift,apple/swift,tardieu/swift,calebd/swift,russbishop/swift,milseman/swift,harlanhaskins/swift,sdulal/swift,atrick/swift,jckarter/swift,calebd/swift,bitjammer/swift,djwbrown/swift,gribozavr/swift,shajrawi/swift,gmilos/swift,allevato/swift,gribozavr/swift,MukeshKumarS/Swift,tinysun212/swift-windows,shajrawi/swift,johnno1962d/swift,russbishop/swift,SwiftAndroid/swift,tkremenek/swift,parkera/swift,stephentyrone/swift,shahmishal/swift,ben-ng/swift,tardieu/swift,swiftix/swift,tinysun212/swift-windows,zisko/swift,jtbandes/swift,felix91gr/swift,tkremenek/swift,xedin/swift,deyton/swift,khizkhiz/swift,aschwaighofer/swift,Jnosh/swift,slavapestov/swift,devincoughlin/swift,CodaFi/swift,swiftix/swift.old,swiftix/swift.old,cbrentharris/swift,gribozavr/swift,apple/swift,CodaFi/swift,ben-ng/swift,tinysun212/swift-windows,khizkhiz/swift,danielmartin/swift,mightydeveloper/swift,IngmarStein/swift,CodaFi/swift,arvedviehweger/swift,adrfer/swift,zisko/swift,therealbnut/swift,natecook1000/swift,benlangmuir/swift,SwiftAndroid/swift,practicalswift/swift,slavapestov/swift,shahmishal/swift,adrfer/swift,ken0nek/swift,milseman/swift,tjw/swift,gottesmm/swift,tinysun212/swift-windows,danielmartin/swift,frootloops/swift,gribozavr/swift,jopamer/swift,kusl/swift,jtbandes/swift,kstaring/swift,uasys/swift,JaSpa/swift,devincoughlin/swift,xedin/swift,sdulal/swift,deyton/swift,return/swift,glessard/swift,cbrentharris/swift,jopamer/swift,stephentyrone/swift,kstaring/swift,OscarSwanros/swift,CodaFi/swift,Jnosh/swift,stephentyrone/swift,xwu/swift,russbishop/swift,tkremenek/swift,ken0nek/swift,benlangmuir/swift,sdulal/swift,cbrentharris/swift,mightydeveloper/swift,swiftix/swift,sschiau/swift,modocache/swift,felix91gr/swift,benlangmuir/swift,airspeedswift/swift,atrick/swift,parkera/swift,hooman/swift,jtbandes/swift,hughbe/swift,glessard/swift,tkremenek/swift,bitjammer/swift,devincoughlin/swift,JGiola/swift,felix91gr/swift,khizkhiz/swift,allevato/swift,ahoppen/swift,jckarter/swift,mightydeveloper/swift,MukeshKumarS/Swift,kusl/swift,JaSpa/swift,KrishMunot/swift,Jnosh/swift,cbrentharris/swift,deyton/swift,harlanhaskins/swift,arvedviehweger/swift,cbrentharris/swift,frootloops/swift,brentdax/swift,uasys/swift,dreamsxin/swift,MukeshKumarS/Swift,JGiola/swift,natecook1000/swift,codestergit/swift,nathawes/swift,tkremenek/swift,tjw/swift,harlanhaskins/swift,practicalswift/swift,jmgc/swift,xwu/swift,natecook1000/swift,huonw/swift,swiftix/swift,kentya6/swift,stephentyrone/swift,deyton/swift,brentdax/swift,zisko/swift,frootloops/swift,Ivacker/swift,apple/swift,sschiau/swift,austinzheng/swift,gregomni/swift,LeoShimonaka/swift,gribozavr/swift,harlanhaskins/swift,SwiftAndroid/swift,roambotics/swift,gregomni/swift,amraboelela/swift,MukeshKumarS/Swift,swiftix/swift,uasys/swift,LeoShimonaka/swift,rudkx/swift,tjw/swift,jopamer/swift,shahmishal/swift,johnno1962d/swift,rudkx/swift,karwa/swift,alblue/swift,felix91gr/swift,felix91gr/swift,nathawes/swift,tkremenek/swift,codestergit/swift,xedin/swift,OscarSwanros/swift,djwbrown/swift,brentdax/swift,gottesmm/swift,gmilos/swift,KrishMunot/swift,tardieu/swift,codestergit/swift,parkera/swift,SwiftAndroid/swift,nathawes/swift,modocache/swift,OscarSwanros/swift,gmilos/swift,jopamer/swift,gottesmm/swift,JaSpa/swift,kusl/swift,kentya6/swift,manavgabhawala/swift,MukeshKumarS/Swift,kusl/swift,IngmarStein/swift,kentya6/swift,swiftix/swift,jckarter/swift,glessard/swift,codestergit/swift,glessard/swift,dduan/swift,mightydeveloper/swift,alblue/swift,karwa/swift,calebd/swift,xwu/swift,swiftix/swift,slavapestov/swift,bitjammer/swift,atrick/swift,roambotics/swift,kusl/swift,LeoShimonaka/swift,kstaring/swift,hughbe/swift,return/swift,swiftix/swift,djwbrown/swift,airspeedswift/swift,gmilos/swift,codestergit/swift,Ivacker/swift,apple/swift,lorentey/swift,allevato/swift,parkera/swift,xedin/swift,emilstahl/swift,sdulal/swift,KrishMunot/swift,JGiola/swift,kperryua/swift,IngmarStein/swift,tinysun212/swift-windows,LeoShimonaka/swift,stephentyrone/swift,gregomni/swift,allevato/swift,zisko/swift,djwbrown/swift,karwa/swift,airspeedswift/swift,hughbe/swift,ahoppen/swift,gregomni/swift,danielmartin/swift,IngmarStein/swift,alblue/swift,kperryua/swift,SwiftAndroid/swift,parkera/swift,aschwaighofer/swift,johnno1962d/swift,IngmarStein/swift,khizkhiz/swift,bitjammer/swift,jtbandes/swift,LeoShimonaka/swift,hooman/swift,gregomni/swift,ken0nek/swift,benlangmuir/swift,Jnosh/swift,danielmartin/swift,brentdax/swift,slavapestov/swift,huonw/swift,harlanhaskins/swift,hooman/swift,rudkx/swift,KrishMunot/swift,jmgc/swift,lorentey/swift,ben-ng/swift,adrfer/swift,therealbnut/swift,gottesmm/swift,devincoughlin/swift,natecook1000/swift,johnno1962d/swift,practicalswift/swift,hughbe/swift,IngmarStein/swift,CodaFi/swift,Ivacker/swift,harlanhaskins/swift,LeoShimonaka/swift,zisko/swift,manavgabhawala/swift,brentdax/swift,slavapestov/swift,nathawes/swift,parkera/swift,khizkhiz/swift,sdulal/swift,shajrawi/swift,Ivacker/swift,kusl/swift,tjw/swift,therealbnut/swift,ken0nek/swift,gribozavr/swift,JaSpa/swift,JGiola/swift,dduan/swift,return/swift,atrick/swift,ben-ng/swift,arvedviehweger/swift,Jnosh/swift,frootloops/swift,OscarSwanros/swift,tkremenek/swift,alblue/swift,xedin/swift,allevato/swift,ben-ng/swift,practicalswift/swift,danielmartin/swift,bitjammer/swift,xwu/swift,dduan/swift,natecook1000/swift,shajrawi/swift,emilstahl/swift,kentya6/swift,russbishop/swift,SwiftAndroid/swift,jmgc/swift,ken0nek/swift,return/swift,xwu/swift,jmgc/swift,parkera/swift,austinzheng/swift,xedin/swift,roambotics/swift,cbrentharris/swift,devincoughlin/swift,manavgabhawala/swift,modocache/swift,zisko/swift,shahmishal/swift,airspeedswift/swift,jckarter/swift,alblue/swift,rudkx/swift,practicalswift/swift,felix91gr/swift,gmilos/swift,manavgabhawala/swift,modocache/swift,ken0nek/swift,manavgabhawala/swift,ahoppen/swift,Ivacker/swift,emilstahl/swift,djwbrown/swift,milseman/swift,danielmartin/swift,kstaring/swift,therealbnut/swift,brentdax/swift,aschwaighofer/swift,allevato/swift,jmgc/swift,cbrentharris/swift,deyton/swift,emilstahl/swift,shajrawi/swift,SwiftAndroid/swift,aschwaighofer/swift,amraboelela/swift,ken0nek/swift,alblue/swift,adrfer/swift,stephentyrone/swift,roambotics/swift,gribozavr/swift,jtbandes/swift,JaSpa/swift,amraboelela/swift,shajrawi/swift,brentdax/swift,milseman/swift,jtbandes/swift,JaSpa/swift,OscarSwanros/swift,practicalswift/swift,cbrentharris/swift,danielmartin/swift,Ivacker/swift,dduan/swift,sdulal/swift,adrfer/swift,rudkx/swift,natecook1000/swift,uasys/swift,jopamer/swift,modocache/swift,emilstahl/swift,OscarSwanros/swift,modocache/swift,jckarter/swift,JaSpa/swift,kentya6/swift,OscarSwanros/swift,xwu/swift,huonw/swift,lorentey/swift,djwbrown/swift,swiftix/swift.old,codestergit/swift,return/swift,gottesmm/swift,gregomni/swift,allevato/swift,kperryua/swift,return/swift,roambotics/swift,calebd/swift,kperryua/swift,arvedviehweger/swift,practicalswift/swift,sschiau/swift,kperryua/swift,jckarter/swift,benlangmuir/swift,emilstahl/swift,aschwaighofer/swift,xwu/swift,MukeshKumarS/Swift,atrick/swift,hooman/swift,swiftix/swift.old,nathawes/swift,mightydeveloper/swift,karwa/swift,gmilos/swift,khizkhiz/swift,sschiau/swift