develooper Front page | perl.perl5.porters | Postings from August 2012

"toke.c: PL_in_eval purge" breaks -Dmad

Thread Previous
Tony Cook
August 31, 2012 06:25
"toke.c: PL_in_eval purge" breaks -Dmad
Message ID:
On Fri, Aug 31, 2012 at 03:18:33AM +0200, Father Chrysostomos wrote:
> In perl.git, the branch blead has been updated
> commit 5c49e90fd624f3ab1cdb1f1d8e4f0525d7881b99
> Author: Father Chrysostomos <>
> Date:   Thu Aug 30 13:34:14 2012 -0700
>     toke.c: PL_in_eval purge
>     Many uses of PL_in_eval in toke.c are redundant.
>     PL_in_eval indicates not that we are parsing a string eval, but that
>     we are being called from an eval, whether stringy on not.  Even if
>     PL_in_eval were only for string eval, it would still not indicate that
>     we are parsing a string eval, because of eval 'require'.
>     This commit removes redundant uses of it (making things theoretically
>     slightly faster).
> M	toke.c

This change breaks lib/warnings.t under -Dmad.

Reverting the first line changed (line 5253):

        if (PL_lex_state != LEX_NORMAL ||
             (PL_in_eval && !PL_rsfp && !PL_parser->filtered)) {
            if (*s == '#' && s == PL_linestart

prevents the failure, but I suspect that's a red herring, as it may
simply mean the PERL_MAD code in the else is being executed instead.

As an aside, the change from (line 5260):

            if (PL_madskills && !PL_lex_formbrack && !PL_in_eval) {
                s = SKIPSPACE0(s);
                if (!PL_in_eval || PL_rsfp || PL_parser->filtered)


            if (PL_madskills && !PL_lex_formbrack && !PL_in_eval) {
                s = SKIPSPACE0(s);
                if (PL_rsfp || PL_parser->filtered)

seems a bit questionable to me purely from a logic point of view.

Prior to the change, the condition for the inner if() is always true,
since the outer if() can only pass if PL_in_eval is false.

After the change that's no longer true.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About