just another small patch for a related bug: subs with builtin
attributes shouldn't become constant subs, for instance:

$ ./perl -e 'sub foo () : assertion { 7 } ; use assertions "1"; print
foo; use assertions "0"; print foo'
77


--- ../perl-current/op.c        2005-06-15 16:08:47.000000000 +0100
+++ op.c        2005-06-15 15:30:58.000000000 +0100
@@ -4295,7 +4295,7 @@
     }
 #endif

-    if (!block || !ps || *ps || attrs)
+    if (!block || !ps || *ps || attrs || (CvFLAGS(PL_compcv) &
CVf_BUILTIN_ATTRS))
        const_sv = Nullsv;
     else
        const_sv = op_const_sv(block, Nullcv);


--- Rafael Garcia-Suarez via RT <[EMAIL PROTECTED]> wrote:

> Salvador "FandiXXo" (via RT) wrote:
> > Builtin attributes are parsed but ignored on subroutine
> declarations,
> > for example:
> > 
> > $ perl -e 'sub foo : lvalue ; foo = 7; sub foo : lvalue { $a }'
> > Can't modify non-lvalue subroutine call in scalar assignment at
> -e
> > line 1, near "7;"
> > Execution of -e aborted due to compilation errors.
> > 
> > 
> > The patch attached solves the problem.
> 
> Thanks, applied as #24851 to bleadperl.
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to