This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse: handle OP_PADRANGE in regex code blocks
authorDavid Mitchell <davem@iabyn.com>
Wed, 22 Feb 2017 16:54:51 +0000 (16:54 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 5 Jun 2017 11:52:17 +0000 (12:52 +0100)
commitb814db6746bca3ed76b5713debbbb44901168a1f
tree54744394fed166134aed01d4f33b40d7f51be323
parent27cbbc57af5b2f37beb0725e483bf78e9f9f1901
Deparse: handle OP_PADRANGE in regex code blocks

Deparse handles the OP_PADRANGE op by overlaying the view of the optree
with the original pad ops (as if they had never been optimised into a
single OP_PADRANGE op).

However, the op treewalk to pessimise such ops wasn't walking into
the op subtrees of code blocks in patterns. So for example

    /(?{ my ($x, $y) = @a; })/

was being deparsed (with a warning) as

    /(?{ (XXX) = @a; })/

With this commit, this passes again:

 ./TEST -deparse re/pat_re_eval.t
lib/B/Deparse.pm
lib/B/Deparse.t