New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pp_quotemeta fails when arg == TARG in 5.6.0-RC1 #1323
Comments
From tom@compton.nuCreated by tom@compton.nuThe following test script fails in 5.6.0-RC1 when built to use my @l = qw(hello world); foreach $x (@l) The problem arises in pp_quotemeta because both the argument and Specifically in this instance we take s as a pointer to the arg and In fact even if the block didn't move the code would fail if any I'm not quite sure why argument and result are the same though, because Perl Info
|
From @gsarOn Sun, 12 Mar 2000 15:53:04 GMT, Tom Hughes wrote:
Thanks for tracking it down. Please try this. Sarathy Inline Patch-----------------------------------8<-----------------------------------
Change 5683 by gsar@auger on 2000/03/12 20:11:45
another optimized-OP_SASSIGN bug: ops that were not OA_TARGLEX
were being mistakenly subverted anyway
Affected files ...
... //depot/perl/dump.c#62 edit
... //depot/perl/op.c#276 edit
... //depot/perl/pod/perldelta.pod#185 edit
... //depot/perl/t/op/misc.t#41 edit
Differences ...
==== //depot/perl/dump.c#62 (text) ====
Index: perl/dump.c
--- perl/dump.c.~1~ Sun Mar 12 12:11:50 2000
+++ perl/dump.c Sun Mar 12 12:11:50 2000
@@ -429,6 +429,10 @@
}
if (o->op_private) {
SV *tmpsv = newSVpvn("", 0);
+ if (PL_opargs[o->op_type] & OA_TARGLEX) {
+ if (o->op_private & OPpTARGET_MY)
+ sv_catpv(tmpsv, ",TARGET_MY");
+ }
if (o->op_type == OP_AASSIGN) {
if (o->op_private & OPpASSIGN_COMMON)
sv_catpv(tmpsv, ",COMMON");
==== //depot/perl/op.c#276 (text) ====
Index: perl/op.c
--- perl/op.c.~1~ Sun Mar 12 12:11:50 2000
+++ perl/op.c Sun Mar 12 12:11:50 2000
@@ -6390,19 +6390,16 @@
o->op_targ = ix;
}
#endif
- /* FALL THROUGH */
- case OP_UC:
- case OP_UCFIRST:
- case OP_LC:
- case OP_LCFIRST:
+ o->op_seq = PL_op_seqmax++;
+ break;
+
case OP_CONCAT:
- case OP_JOIN:
- case OP_QUOTEMETA:
if (o->op_next && o->op_next->op_type == OP_STRINGIFY) {
if (o->op_next->op_private & OPpTARGET_MY) {
if (o->op_flags & OPf_STACKED) /* chained concats */
goto ignore_optimization;
else {
+ /* assert(PL_opargs[o->op_type] & OA_TARGLEX); */
o->op_targ = o->op_next->op_targ;
o->op_next->op_targ = 0;
o->op_private |= OPpTARGET_MY;
==== //depot/perl/pod/perldelta.pod#185 (text) ====
Index: perl/pod/perldelta.pod
--- perl/pod/perldelta.pod.~1~ Sun Mar 12 12:11:50 2000
+++ perl/pod/perldelta.pod Sun Mar 12 12:11:50 2000
@@ -722,7 +722,7 @@
nor -Duse64bitall.
Last but not least: note that due to Perl's habit of always using
-floating point numbers the quads are still not true integers.
+floating point numbers, the quads are still not true integers.
When quads overflow their limits (0...18_446_744_073_709_551_615 unsigned,
-9_223_372_036_854_775_808...9_223_372_036_854_775_807 signed), they
are silently promoted to floating point numbers, after which they will
==== //depot/perl/t/op/misc.t#41 (xtext) ====
Index: perl/t/op/misc.t
--- perl/t/op/misc.t.~1~ Sun Mar 12 12:11:50 2000
+++ perl/t/op/misc.t Sun Mar 12 12:11:50 2000
@@ -515,3 +515,33 @@
print "ok\n";
EXPECT
ok
+########
+my @l = qw(hello.* world);
+my $x;
+
+foreach $x (@l) {
+ print "before - $x\n";
+ $x = "\Q$x\E";
+ print "quotemeta - $x\n";
+ $x = "\u$x";
+ print "ucfirst - $x\n";
+ $x = "\l$x";
+ print "lcfirst - $x\n";
+ $x = "\U$x\E";
+ print "uc - $x\n";
+ $x = "\L$x\E";
+ print "lc - $x\n";
+}
+EXPECT
+before - hello.*
+quotemeta - hello\.\*
+ucfirst - Hello\.\*
+lcfirst - hello\.\*
+uc - HELLO\.\*
+lc - hello\.\*
+before - world
+quotemeta - world
+ucfirst - World
+lcfirst - world
+uc - WORLD
+lc - world
End of Patch. |
From [Unknown Contact. See original ticket]In message <200003122020.MAA02772@maul.ActiveState.com>
Yep. With that patch applied Date::Manip passes all it's self Tom -- |
Migrated from rt.perl.org#2348 (status was 'resolved')
Searchable as RT2348$
The text was updated successfully, but these errors were encountered: