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

[perl #7528] Bug with AUTOLOAD, XS, and : lvalue

From:
Michael G Schwern via RT
Date:
July 14, 2005 03:42
Subject:
[perl #7528] Bug with AUTOLOAD, XS, and : lvalue
Message ID:
rt-3.0.11-7528-117342.16.8164628110745@perl.org
> [dmlloyd - Tue Aug 14 04:33:09 2001]:
> 
> If you extract the attached module and do this:
> 
>   perl Makefile.PL
>   make
>   perl -Mblib -MBugDemo -e 'BugDemo->querble = 1234'
> 
> in perl 5.6.1, it works but in 5.7.2, you get:
> 
>   Can't modify non-lvalue subroutine call at -e line 1.
> 
> -----------------
> 
> Here's the gory details. I've declared (but NOT defined) a sub called
> querble like this:
> 
>   sub querble : lvalue method;
> 
> I've also got an xsub decared like this:
> 
>   sub implemented_in_xs : lvalue method;
> 
> and impemented in BugDemo.xs.  It simply makes a magic IV, just to
> demonstrate the problem.  Finally, I have an AUTOLOAD:
> 
>   sub AUTOLOAD {
>     $_[0]->implemented_in_xs();
>   }
> 
> The end result should be that a call to 'querble' will be bounced into
> 'implemented_in_xs'.  And this is exactly how it works in 5.6.1, but
> not
> in 5.7.2.  I use this feature extensively in one of my modules, and it
> would be a major bummer if it went away.... especially because I don't
> see
> how else I can make an lvalue xsub!

5.8.6 still has this bug.  bleadperl@25129 has improved on it!

0 ~/Downloads/BugDemo-0.01$ bleadperl -Mblib -MBugDemo -e
'BugDemo->querble = 1234'
Bus error




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