so don't upgrade them to ORANGE before attaching qr magic.
(And don't stop using qr magic once regexps become first class)
p4raw-id: //depot/perl@32748
if (!(SvFLAGS(ret)
& (SVs_TEMP | SVs_PADTMP | SVf_READONLY
| SVs_GMG))) {
- SvUPGRADE(ret, SVt_ORANGE);
+ /* This isn't a first class regexp. Instead, it's
+ caching a regexp onto an existing, Perl visible
+ scalar. */
sv_magic(ret,(SV*)ReREFCNT_inc(re),
PERL_MAGIC_qr,0,0);
}
}
}
+{
+ my $a = 3; "" =~ /(??{ $a })/;
+ my $b = $a;
+ iseq($b, $a, "copy of scalar used for postponed subexpression");
+}
+
# Test counter is at bottom of file. Put new tests above here.
#-------------------------------------------------------------------
# Keep the following tests last -- they may crash perl
iseq(0+$::test,$::TestCount,"Got the right number of tests!");
# Don't forget to update this!
BEGIN {
- $::TestCount = 4013;
+ $::TestCount = 4014;
print "1..$::TestCount\n";
}