develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #119051] SEGFAULT when trying to reference a non-code ref as a code ref

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
July 28, 2013 19:48
Subject:
[perl #119051] SEGFAULT when trying to reference a non-code ref as a code ref
Message ID:
rt-3.6.HEAD-2552-1375040901-247.119051-15-0@perl.org
On Sun Jul 28 08:10:02 2013, sprout wrote:
> On Sun Jul 28 07:21:40 2013, kentfredric@gmail.com wrote:
> > The following code snippet causes Perl to segfault :
> > 
> > $Foo::nosub  = undef;
> > my $ref =  *Foo::->{nosub};
> 
> What you have there is a glob, not a reference.
> 
> > my $deref = \&$ref;
> 
> It was probably this commit that caused it:
> 
> commit 186a5ba82d5844e9713475c494fcd6682968609f
> Author: Father Chrysostomos <sprout@cpan.org>
> Date:   Wed Jun 13 22:46:40 2012 -0700
> 
>     Don’t create pads for sub stubs
> 
> The bug can be reduced to this:
> 
> $ref = *Foo::nosub;
> \&$ref;

I have fixed this in 2f222bb.  The bug is actually older than 186a5ba82,
but was harder to trigger.  See the second test in the commit.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=119051

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About