develooper Front page | perl.perl5.porters | Postings from April 2010

Re: Make POPEVAL() pop cx->blk_eval.old_namesv into a newsv localvariable

Thread Previous | Thread Next
From:
Vincent Pit
Date:
April 25, 2010 08:32
Subject:
Re: Make POPEVAL() pop cx->blk_eval.old_namesv into a newsv localvariable
Message ID:
4BD46064.30100@profvince.com

> Why don't you declare namesv in the POPEVAL block ?
> --- a/cop.h
> +++ b/cop.h
> @@ -436,11 +436,13 @@ struct block_eval {
>
>   #define POPEVAL(cx)                                                    \
>       STMT_START {                                                       \
> +       SV *namesv;                                                     \
>          PL_in_eval = CxOLD_IN_EVAL(cx);                                 \
>          optype = CxOLD_OP_TYPE(cx);                                     \
>          PL_eval_root = cx->blk_eval.old_eval_root;                      \
> -       if (cx->blk_eval.old_namesv)                                    \
> -           sv_2mortal(cx->blk_eval.old_namesv);                        \
> +       namesv = cx->blk_eval.old_namesv;                               \
> +       if (namesv)                                                     \
> +           sv_2mortal(namesv);                                         \
>       } STMT_END
Because it's needed outside of the macro to print the right file name 
when an error happens during require.

I'll commit a fix that doesn't change POPEVAL, so that it can be 
integrated if wanted. Nothing will prevent us from changing POPEVAL later.

Vincent.

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