summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-12-15 09:23:11 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-12-15 12:58:01 -0800
commit3b91d897677547cb4be755c60725a628ac435fe1 (patch)
treef953ea8cda0f7dacc3e30bde3d0e129d77965bad /lib
parent1f3063473777c9458d9e5c34697672aec5358f41 (diff)
downloadperl-3b91d897677547cb4be755c60725a628ac435fe1.tar.gz
Deparse: Stop =~ QR_CONST from dropping flags
Diffstat (limited to 'lib')
-rw-r--r--lib/B/Deparse.pm6
-rw-r--r--lib/B/Deparse.t6
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm
index f1f45f8dd4..550a4a17dc 100644
--- a/lib/B/Deparse.pm
+++ b/lib/B/Deparse.pm
@@ -5313,6 +5313,12 @@ sub re_flags {
my ($self, $op) = @_;
my $flags = '';
my $pmflags = $op->pmflags;
+ if (!$pmflags) {
+ my $re = $op->pmregexp;
+ if ($$re) {
+ $pmflags = $re->compflags;
+ }
+ }
$flags .= "g" if $pmflags & PMf_GLOBAL;
$flags .= "i" if $pmflags & PMf_FOLD;
$flags .= "m" if $pmflags & PMf_MULTILINE;
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t
index 740138a3e2..0ad4d00416 100644
--- a/lib/B/Deparse.t
+++ b/lib/B/Deparse.t
@@ -1230,6 +1230,12 @@ print /@b/;
print qr/@a/;
print qr/@b/;
####
+# =~ QR_CONSTANT
+use constant QR_CONSTANT => qr/a/soupmix;
+'' =~ QR_CONSTANT;
+>>>>
+'' =~ /a/impsux;
+####
# $lexical =~ //
my $x;
$x =~ //;