Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #67058] Null PMC access in strange condition with state variables.

0 views
Skip to first unread message

Kyle Hasselbacher

unread,
Jun 29, 2009, 1:34:58 PM6/29/09
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by "Kyle Hasselbacher"
# Please include the string: [perl #67058]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67058 >


I discovered this while trying to write a test for another bug report.
Here's the minimal test, which I'll put in
pugs/t/spec/S04-declarations/state-rtXXXXX.t once I get a number back
from this bug report.

use v6;

use Test;

plan 1;

sub bughunt1 { (state $svar) }
{
sub bughunt2 { state $x //= 17; $x++ }
#?rakudo todo 'b0rk'
lives_ok { bughunt2() },
'a state variable in parens lives with a state variable with //= init';
}

I've tried removing pretty much every part of this test case, and it's
all necessary.

* state $svar in parens in bughunt1.
* braces around bughunt2 definition.
* Assignment and modification of $x
* call to bughunt2

jnthn@jnthn.net via RT

unread,
Jun 30, 2009, 12:10:38 PM6/30/09
to perl6-c...@perl.org
On Mon Jun 29 10:34:57 2009, KyleHa wrote:
> I discovered this while trying to write a test for another bug report.
> Here's the minimal test, which I'll put in
> pugs/t/spec/S04-declarations/state-rtXXXXX.t once I get a number back
> from this bug report.
>
The bug is fixed and that test now passes. KyleHa++ has moved the test
into state.t, which means it's now tested too. So, resolving ticket!

Thanks,

Jonathan

0 new messages