[Ironruby-core] "Taint" and (internal) copy constructors

Tomas Matousek Tomas.Matousek at microsoft.com
Thu Oct 25 02:15:00 EDT 2007


Freezing and tainting are not supported yet. We have only "stubs" for them today.

Tomas

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Curt Hagenlocher
Sent: Wednesday, October 24, 2007 11:06 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] "Taint" and (internal) copy constructors

Currently, the copy constructors for the MutableString class will "lose" the taint flag on the string being copied.  One practical consequence of this is that any builtins that store local copies of the MutableString would have to manually fix the taint flag.  Wouldn't it be better if the default behavior were to preserve this information?

Under CRuby,
a = "123"        => "123"
a.taint          => "123"
a.clone.tainted? => true
a[1,1].tainted?  => true

Under IronRuby,
a = "123"        => "123"
a.taint          => "123"
a.clone.tainted? => true
a[1,1].tainted?  => false

It appears that RubyUtils.TryCopyObject is the only place where this flag is preserved, and this function is called by both Object.clone and Object.dup.

--
Curt Hagenlocher
curt at hagenlocher.org<mailto:curt at hagenlocher.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20071024/ddc1ac96/attachment.html 


More information about the Ironruby-core mailing list