Skip Menu |
Report information
Id: 79464
Status: resolved
Priority: 0/
Queue: perl6

Owner: jnthn [at] jnthn.net
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag:
  • Bug
  • testneeded
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Null PMC access when accessing module variable from within sub called from outside the module in Rakudo
Date: Fri, 19 Nov 2010 23:48:16 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 757b
<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.
Still happens in rakudo 33f1cf. -- Will "Coke" Coleda
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 896b
On Fri Nov 19 14:48:40 2010, masak wrote: Show quoted text
> <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
Download (untitled) / with headers
text/plain 1010b
I've added a test case to S10-packages/basic.t On Tue Aug 19 06:47:58 2014, coke wrote: Show quoted text
> 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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org