Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null PMC access when looping over SomeEnum.enums in a blockless BEGIN in Rakudo #3230

Closed
p6rt opened this issue Sep 12, 2013 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Sep 12, 2013

Migrated from rt.perl.org#119749 (status was 'rejected')

Searchable as RT119749$

@p6rt
Copy link
Author

p6rt commented Sep 12, 2013

From @masak

<poor_soul> is it ok for this to crash?
<poor_soul> r​: enum A (a=>3,b=>10,c=>1); class B { BEGIN for
A.enums.kv -> $k, $v { our $k :​:= $v }; }; say B.b
<camelia> rakudo 69c3cc​: OUTPUT«===SORRY!===␤Null PMC access in get_bool()␤»
<tadzik> certainly not in this way
<masak> poor_soul​: certainly not ok.
* masak submits rakudobug
<mathw> "Null PMC access" is always a bug, IIRC
<moritz> overwriting B​::k with each enum value in turn doesn't sound too useful
<poor_soul> i was trying to find a way to declare constants in a class
based on a enum
<jnthn> poor_soul​: Does declaring the enum in the class not do it? :)
<poor_soul> jnthn​: it does only partially, since if i want to use it,
i need to put the name of the enum
<jnthn> r​: class A { enum B <c d e>; method m() { say e } }; A.m
<camelia> rakudo 69c3cc​: OUTPUT«e␤»
<jnthn> r​: class A { enum B <c d e>; method m() { say +e } }; A.m
<camelia> rakudo 69c3cc​: OUTPUT«2␤»
<masak> r​: enum A (a=>3); class B { BEGIN for A.enums {} } # golf'd
<camelia> rakudo 69c3cc​: OUTPUT«===SORRY!===␤Null PMC access in get_bool()␤»
<masak> ooh, in fact...
<masak> r​: enum A (a=>3); BEGIN for A.enums {}
<camelia> rakudo 69c3cc​: OUTPUT«===SORRY!===␤Null PMC access in get_bool()␤»
<jnthn> Short names seem to work to me.
<jnthn> r​: enum A (a=>3); BEGIN A.enums
<camelia> rakudo 69c3cc​: ( no output )
<jnthn> r​: enum A (a=>3); BEGIN A.enums.perl.say
<camelia> rakudo 69c3cc​: OUTPUT«("a" => 3).hash␤»
<jnthn> r​: enum A (a=>3); BEGIN { for A.enums { }; 1 }
<camelia> rakudo 69c3cc​: ( no output )
<jnthn> r​: enum A (a=>3); BEGIN { for A.enums { } }
<camelia> rakudo 69c3cc​: ( no output )
<jnthn> r​: enum A (a=>3); BEGIN for A.enums { }
<camelia> rakudo 69c3cc​: OUTPUT«===SORRY!===␤Null PMC access in get_bool()␤»
<jnthn> wow...you need the blockless form to trigger it.

@p6rt
Copy link
Author

p6rt commented Oct 22, 2014

From @usev6

There is still a Null PMC access on Parrot. On Moar and JVM it runs fine​:

$ perl6-p -e 'enum A (a=>3); BEGIN for A.enums { }'
===SORRY!===
Null PMC access in get_bool()

$ perl6-m -e 'enum A (a=>3); BEGIN for A.enums { }; say "alive"'
alive

$ perl6-j -e 'enum A (a=>3); BEGIN for A.enums { }; say "alive"'
alive

I added a test (fudged 'skip' for Parrot) to S04-phasers/begin.t with commit Raku/roast@489ebb2e46.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 22, 2014

From @usev6

There is still a Null PMC access on Parrot. On Moar and JVM it runs fine​:

$ perl6-p -e 'enum A (a=>3); BEGIN for A.enums { }'
===SORRY!===
Null PMC access in get_bool()

$ perl6-m -e 'enum A (a=>3); BEGIN for A.enums { }; say "alive"'
alive

$ perl6-j -e 'enum A (a=>3); BEGIN for A.enums { }; say "alive"'
alive

I added a test (fudged 'skip' for Parrot) to S04-phasers/begin.t with commit Raku/roast@489ebb2e46.

@p6rt
Copy link
Author

p6rt commented Oct 22, 2014

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 27, 2015

From @usev6

Since support for Parrot was suspended with Rakudo Star Release 2015.02, I'm closing this "parrot only" ticket.

I added the ticket to a list of closed ticket living in the Mu repository​: https://github.com/perl6/mu/blob/master/misc/rt.perl.org/tickets_closed_parrot_only.txt.

In case support for Parrot will be restored in some future release the listed tickets can be checked and re-opened as appropriate.

@p6rt
Copy link
Author

p6rt commented Feb 27, 2015

@usev6 - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant