This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make recent re_eval changes compile under -Dmad
authorDavid Mitchell <davem@iabyn.com>
Mon, 12 Sep 2011 13:32:11 +0000 (14:32 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:25:49 +0000 (13:25 +0100)
Note that this doesn't mean that MAD output is correct; I haven't tested
that. In particular, I have no idea when and how CURMAD() is supposed to
be used.

toke.c

diff --git a/toke.c b/toke.c
index a823597..3b7ada2 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -4647,6 +4647,8 @@ Perl_yylex(pTHX)
            PL_bufptr += 2;
            if (*PL_bufptr != '{')
                PL_bufptr++;
            PL_bufptr += 2;
            if (*PL_bufptr != '{')
                PL_bufptr++;
+           start_force(PL_curforce);
+           /* XXX probably need a CURMAD(something) here */
            PL_expect = XTERMBLOCK;
            force_next(DO);
        }
            PL_expect = XTERMBLOCK;
            force_next(DO);
        }
@@ -4702,7 +4704,9 @@ Perl_yylex(pTHX)
            PL_bufptr++;
            /* having compiled a (?{..}) expression, return the original
             * text too, as a const */
            PL_bufptr++;
            /* having compiled a (?{..}) expression, return the original
             * text too, as a const */
-           PL_nextval[PL_nexttoke].opval =
+           start_force(PL_curforce);
+           /* XXX probably need a CURMAD(something) here */
+           NEXTVAL_NEXTTOKE.opval =
                    (OP*)newSVOP(OP_CONST, 0,
                        newSVpvn(PL_sublex_info.re_eval_start,
                                PL_bufptr - PL_sublex_info.re_eval_start));
                    (OP*)newSVOP(OP_CONST, 0,
                        newSVpvn(PL_sublex_info.re_eval_start,
                                PL_bufptr - PL_sublex_info.re_eval_start));