This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Properly restore PL_curcop after /(?{})/
authorDavid Mitchell <davem@iabyn.com>
Fri, 15 Jun 2012 09:58:40 +0000 (10:58 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 15 Jun 2012 11:16:23 +0000 (12:16 +0100)
commit0e4583182e9cedfe89ebed523f895f8a5e1325d7
tree9471d127fbd1e280cfa90ddc2399590953fd630c
parent799c141b0d84da23cb73651216e5189e989bf37d
Properly restore PL_curcop after /(?{})/

C</$code/ or die> was reporting the place of dying as being in
an eval rather than in the main body of the code. This was because
when calling the code, we were setting PL_curcop to the inner code block
*before* doing the PUSH_MULTICALL, which happens to save PL_curcop;
the wrong value was then  being restored at the end of the function with
the POP_MULTICALL.

The fix is easy: just swap the two blocks of code that set PL_curcop and
do the PUSH_MULTICALL.
regexec.c
t/re/reg_eval_scope.t