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 accessing module variable from within sub called from outside the module in Rakudo #2270

Closed
p6rt opened this issue Nov 19, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Nov 19, 2010

Migrated from rt.perl.org#79464 (status was 'resolved')

Searchable as RT79464$

@p6rt
Copy link
Author

p6rt commented Nov 19, 2010

From @masak

<jnthn> rakudo​: Foo​::bar(); module Foo { our $x = 42; our sub bar() { $x.say } }
<p6eval> rakudo : OUTPUT«Null PMC access in find_method('say')␤ in
'Foo​::bar' [...]
<masak> ISTR that bug is in RT somewhere.
* masak looks
<masak> hm. seems not.
* masak submits rakudobug
<masak> rakudo​: Foo​::bar(); module Foo { my $x; our sub bar { $x.say } }
<p6eval> rakudo : OUTPUT«Null PMC access in find_method('say')␤ in
'Foo​::bar' [...]
<masak> rakudo​: module Foo { my $x; sub bar { $x.say }; bar }
<p6eval> rakudo : OUTPUT«Any()␤»

The Foo​::bar() call shouldn't be made before the declaration of the
module -- submitting that as a separate ticket. But even putting them
after the module, the result is the same, since the call is made at
runtime anyway.

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

From @coke

Still happens in rakudo 33f1cf.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

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

@p6rt
Copy link
Author

p6rt commented Aug 19, 2014

From @coke

On Fri Nov 19 14​:48​:40 2010, masak wrote​:

<jnthn> rakudo​: Foo​::bar(); module Foo { our $x = 42; our sub bar() {
$x.say } }
<p6eval> rakudo : OUTPUT«Null PMC access in find_method('say')␤ in
'Foo​::bar' [...]
<masak> ISTR that bug is in RT somewhere.
* masak looks
<masak> hm. seems not.
* masak submits rakudobug
<masak> rakudo​: Foo​::bar(); module Foo { my $x; our sub bar { $x.say }
}
<p6eval> rakudo : OUTPUT«Null PMC access in find_method('say')␤ in
'Foo​::bar' [...]
<masak> rakudo​: module Foo { my $x; sub bar { $x.say }; bar }
<p6eval> rakudo : OUTPUT«Any()␤»

The Foo​::bar() call shouldn't be made before the declaration of the
module -- submitting that as a separate ticket. But even putting them
after the module, the result is the same, since the call is made at
runtime anyway.

Now working; closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 23, 2014

From @dwarring

I've added a test case to S10-packages/basic.t

On Tue Aug 19 06​:47​:58 2014, coke wrote​:

On Fri Nov 19 14​:48​:40 2010, masak wrote​:

<jnthn> rakudo​: Foo​::bar(); module Foo { our $x = 42; our sub bar() {
$x.say } }
<p6eval> rakudo : OUTPUT«Null PMC access in find_method('say')␤ in
'Foo​::bar' [...]
<masak> ISTR that bug is in RT somewhere.
* masak looks
<masak> hm. seems not.
* masak submits rakudobug
<masak> rakudo​: Foo​::bar(); module Foo { my $x; our sub bar { $x.say }
}
<p6eval> rakudo : OUTPUT«Null PMC access in find_method('say')␤ in
'Foo​::bar' [...]
<masak> rakudo​: module Foo { my $x; sub bar { $x.say }; bar }
<p6eval> rakudo : OUTPUT«Any()␤»

The Foo​::bar() call shouldn't be made before the declaration of the
module -- submitting that as a separate ticket. But even putting them
after the module, the result is the same, since the call is made at
runtime anyway.

Now working; closable with tests.

@p6rt p6rt closed this as completed Aug 23, 2014
@p6rt
Copy link
Author

p6rt commented Aug 23, 2014

@coke - Status changed from 'open' to 'resolved'

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