[perl #66104] Bugs in extended regexp features
authorFather Chrysostomos <sprout@cpan.org>
Wed, 8 Dec 2010 02:02:16 +0000 (18:02 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 8 Dec 2010 02:03:12 +0000 (18:03 -0800)
commit558b442404962caba5a81ad5b785fef3cf5eac5d
treeb23e9298591a9090bd811294da6d1546155f44da
parent1af910ea8358b80143d7e7c877436232e1fde3ec
[perl #66104] Bugs in extended regexp features

More precisely: Make run-time (?{...}) inherit pragmata.

This commit makes Perl_sv_compile_2op_is_broken (nice name!) copy the
hints from PL_curcop if invoked during run time. Usually they are
inherited from the code that is currently being compiled (which works
for $foo =~ /(?{...})/), but the code currently being compiled is not
the enclosing scope at run time ($bar = '(?{...})'; $foo =~ $bar),
hence the need for copying in a similar manner to pp_entereval.

Theoretically this code should also have to avoid copying a statement
label, but goto inside a regexp eval does not currently work, so I
cannot prove or disprove that yet.
pp_ctl.c
t/re/reg_eval_scope.t