In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/634d6919699655c843f8d8c3ea64922d0403c499?hp=31be325893db1b4bd951b7e64f1557d4c5ca6246>

- Log -----------------------------------------------------------------
commit 634d6919699655c843f8d8c3ea64922d0403c499
Author: George Greer <[email protected]>
Date:   Sat Jul 10 19:18:12 2010 -0400

    Fix for RT#2353: catch yyparse() exceptions in (?{...})
    
    Ticket is entitled:
    "panic: top_env when localizing a lexical variable in qr{(?{...})}"
    
    but a better description would be:
    "(?{...}) does not catch yyparse() exceptions in regex compilation"
    
    Changes Perl_sv_compile_2op() to tell doeval() that it must use
    S_try_yyparse() to catch any exception that yyparse() may throw.
-----------------------------------------------------------------------

Summary of changes:
 pp_ctl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/pp_ctl.c b/pp_ctl.c
index 1bac360..a93d6dc 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2914,6 +2914,7 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const 
char *code, PAD** padp)
     int runtime;
     CV* runcv = NULL;  /* initialise to avoid compiler warnings */
     STRLEN len;
+    bool need_catch;
 
     PERL_ARGS_ASSERT_SV_COMPILE_2OP;
 
@@ -2965,11 +2966,14 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const 
char *code, PAD** padp)
     PL_op->op_flags = 0;                       /* Avoid uninit warning. */
     PUSHBLOCK(cx, CXt_EVAL|(IN_PERL_COMPILETIME ? 0 : CXp_REAL), SP);
     PUSHEVAL(cx, 0);
+    need_catch = CATCH_GET;
+    CATCH_SET(TRUE);
 
     if (runtime)
        (void) doeval(G_SCALAR, startop, runcv, PL_curcop->cop_seq);
     else
        (void) doeval(G_SCALAR, startop, PL_compcv, PL_cop_seqmax);
+    CATCH_SET(need_catch);
     POPBLOCK(cx,PL_curpm);
     POPEVAL(cx);
 

--
Perl5 Master Repository

Reply via email to