From: Tomas Matousek Date: 2007-08-24T02:28:02+09:00 Subject: Bug in exception message initialization --_000_F58FE69873E2D5459B72C347DE15824116B6199049NAEXMSGC112re_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable irb(main):001:0> x =3D IOError.new =3D> # irb(main):002:0> x.message[0] =3D 'X' =3D> "X" irb(main):003:0> x =3D> # irb(main):004:0> x.class =3D> XOError It seems the exception constructor copies a pointer to the class name inste= ad of making a copy of the name. Tomas --_000_F58FE69873E2D5459B72C347DE15824116B6199049NAEXMSGC112re_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

irb(main):001:0> x =3D IOError.new

=3D> #<IOError: IOError>

 

irb(main):002:0> x.message[0] =3D 'X'

=3D> "X"

 

irb(main):003:0> x

=3D> #<XOError: XOError>

 

irb(main):004:0> x.class

=3D> XOError<= /o:p>

 

It seems the exception constructor copies a pointer to= the class name instead of making a copy of the name.

 

Tomas

 

--_000_F58FE69873E2D5459B72C347DE15824116B6199049NAEXMSGC112re_--