Re: [perl #60528] Rakudo wrongly permits mutation of readonly variables in some cases

2008-11-17 Thread Moritz Lenz
[EMAIL PROTECTED] via RT wrote:

 I've fixed it in a patch that's about to go in as soon as it smokes;
 please can somebody make sure that a regression test goes in for this.

test added in (pugs) r23032.

I hereby encourage all Rakudo hackers to give tickets to me if they have
fixed it, but there are no tests yet (with an appropriate comment, of
course). I can't promise to write tests for everything, but the chances
are much higher that way.

Cheers,
Moritz

-- 
Moritz Lenz
http://perlgeek.de/ |  http://perl-6.de/ | http://sudokugarden.de/


Re: [perl #60528] Rakudo wrongly permits mutation of readonly variables in some cases

2008-11-17 Thread Patrick R. Michaud
On Mon, Nov 17, 2008 at 10:15:09PM +0100, Moritz Lenz wrote:
 I hereby encourage all Rakudo hackers to give tickets to me if they have
 fixed it, but there are no tests yet (with an appropriate comment, of
 course). I can't promise to write tests for everything, but the chances
 are much higher that way.

I go further and make this standard policy:  We don't close a ticket
until there's a test.  For now we'll assign fixed but no test yet
tickets to moritz.

It would be nice if the ticket also mentioned where the appropriate
test has been placed.

Pm


[perl #60528] Rakudo wrongly permits mutation of readonly variables in some cases

2008-11-16 Thread [EMAIL PROTECTED] via RT
On Fri Nov 14 05:58:21 2008, pmichaud wrote:
 On Thu, Nov 13, 2008 at 03:21:45PM -0800, Carl Mäsak wrote:
  Rakudo r32629 sometimes dies when assigning a readonly variable to
  itself, and sometimes not.
  
  $ ./perl6 -e 'for a b c - $foo { $foo = $foo; say $foo }' # dies,
good
  Cannot assign to readonly variable.
  [...]
  
  $ ./perl6 -e 'for split(/sp/, a b c) - $foo { $foo = $foo; say
  $foo }' # bhd!
  a
  b
  c
 
 There's a bit more going on behind the scenes here -- the $foo = $foo
 line in the second case is also promoting Parrot String values into
 Rakudo Str objects.  I suspect that promotion is causing the
 readonly property on $foo to be lost.
 
 My guess is that we want to adjust Parrot's Ccopy opcode so that
 it doesn't modify the destination PMC's properties.
 
I've fixed it in a patch that's about to go in as soon as it smokes;
please can somebody make sure that a regression test goes in for this.

Thanks,

Jonathan



[perl #60528] Rakudo wrongly permits mutation of readonly variables in some cases

2008-11-14 Thread Carl Mäsak
# New Ticket Created by  Carl Mäsak 
# Please include the string:  [perl #60528]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60528 


Rakudo r32629 sometimes dies when assigning a readonly variable to
itself, and sometimes not.

$ ./perl6 -e 'for a b c - $foo { $foo = $foo; say $foo }' # dies, good
Cannot assign to readonly variable.
[...]

$ ./perl6 -e 'for split(/sp/, a b c) - $foo { $foo = $foo; say
$foo }' # bhd!
a
b
c


Re: [perl #60528] Rakudo wrongly permits mutation of readonly variables in some cases

2008-11-14 Thread Patrick R. Michaud
On Thu, Nov 13, 2008 at 03:21:45PM -0800, Carl Mäsak wrote:
 Rakudo r32629 sometimes dies when assigning a readonly variable to
 itself, and sometimes not.
 
 $ ./perl6 -e 'for a b c - $foo { $foo = $foo; say $foo }' # dies, good
 Cannot assign to readonly variable.
 [...]
 
 $ ./perl6 -e 'for split(/sp/, a b c) - $foo { $foo = $foo; say
 $foo }' # bhd!
 a
 b
 c

There's a bit more going on behind the scenes here -- the $foo = $foo
line in the second case is also promoting Parrot String values into
Rakudo Str objects.  I suspect that promotion is causing the
readonly property on $foo to be lost.

My guess is that we want to adjust Parrot's Ccopy opcode so that
it doesn't modify the destination PMC's properties.

Thanks,

Pm