Revision: 2853 http://trac.macosforge.org/projects/ruby/changeset/2853 Author: lsansonetti@apple.com Date: 2009-10-19 16:06:34 -0700 (Mon, 19 Oct 2009) Log Message: ----------- String#dup: make sure we honor the receiver's class Modified Paths: -------------- MacRuby/trunk/string.c Modified: MacRuby/trunk/string.c =================================================================== --- MacRuby/trunk/string.c 2009-10-19 22:52:16 UTC (rev 2852) +++ MacRuby/trunk/string.c 2009-10-19 23:06:34 UTC (rev 2853) @@ -326,17 +326,16 @@ { VALUE dup; -#if 1 if (*(VALUE *)str == rb_cByteString) { dup = rb_bytestring_copy(str); } else { dup = (VALUE)CFStringCreateMutableCopy(NULL, 0, (CFStringRef)str); CFMakeCollectable((CFTypeRef)dup); + if (*(VALUE *)str != rb_cSymbol) { + *(VALUE *)dup = *(VALUE *)str; + } } -#else - dup = (VALUE)objc_msgSend((id)str, selMutableCopy); -#endif if (OBJ_TAINTED(str)) { OBJ_TAINT(dup);
participants (1)
-
source_changes@macosforge.org