yyerror->yyerror_pvn in toke.c:S_new_constant
authorDaniel Dragan <bulk88@hotmail.com>
Sat, 27 Oct 2012 09:18:49 +0000 (05:18 -0400)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 28 Oct 2012 09:04:58 +0000 (02:04 -0700)
Avoids a strlen.

toke.c

diff --git a/toke.c b/toke.c
index e4c1f80..a382619 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -8974,8 +8974,11 @@ now_ok:
 
     /* Check the eval first */
     if (!PL_in_eval && SvTRUE(ERRSV)) {
-       sv_catpvs(ERRSV, "Propagated");
-       yyerror(SvPV_nolen_const(ERRSV)); /* Duplicates the message inside eval */
+       STRLEN errlen;
+       const char * errstr;
+       sv_catpvs(ERRSV, "Propagated");
+       errstr = SvPV_const(ERRSV, errlen);
+       yyerror_pvn(errstr, errlen, 0); /* Duplicates the message inside eval */
        (void)POPs;
        res = SvREFCNT_inc_simple(sv);
     }