diff options
author | knew-p5p@pimb.org <knew-p5p@pimb.org> | 2007-02-10 11:32:17 -0800 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-02-11 16:20:15 +0000 |
commit | c8c13c2248f0124bc4c3d1625cab2bdb0be6c8da (patch) | |
tree | 7035cc7f91f8c2d963418bf5a255e2e81cd43a42 | |
parent | 76a476f9104f7947fe0fedc97cbf22a34bfffa87 (diff) | |
download | perl-c8c13c2248f0124bc4c3d1625cab2bdb0be6c8da.tar.gz |
[perl #41484] qr// stack bug
From: knew-p5p@pimb.org (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-14573-1171164736-117.41484-75-0@perl.org>
p4raw-id: //depot/perl@30211
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | pp_hot.c | 3 | ||||
-rw-r--r-- | t/op/qrstack.t | 21 |
3 files changed, 24 insertions, 1 deletions
@@ -3581,6 +3581,7 @@ t/op/pow.t See if ** works t/op/push.t See if push and pop work t/op/pwent.t See if getpw*() functions work t/op/qq.t See if qq works +t/op/qrstack.t See if qr expands the stack properly t/op/quotemeta.t See if quotemeta works t/op/rand.t See if rand works t/op/range.t See if .. works @@ -1172,7 +1172,8 @@ PP(pp_qr) if (pm->op_pmdynflags & PMdf_TAINTED) SvTAINTED_on(rv); sv_magic(sv,(SV*)ReREFCNT_inc(PM_GETRE(pm)), PERL_MAGIC_qr,0,0); - RETURNX(PUSHs(rv)); + XPUSHs(rv); + RETURN; } PP(pp_match) diff --git a/t/op/qrstack.t b/t/op/qrstack.t new file mode 100644 index 0000000000..6483eba38f --- /dev/null +++ b/t/op/qrstack.t @@ -0,0 +1,21 @@ +#!./perl + +my $test = 1; +sub ok { + my($ok, $name) = @_; + + # You have to do it this way or VMS will get confused. + printf "%s %d%s\n", $ok ? "ok" : "not ok", + $test, + defined $name ? " - $name" : ''; + + printf "# Failed test at line %d\n", (caller)[2] unless $ok; + + $test++; + return $ok; +} + +print "1..1\n"; + +ok(defined [(1)x127,qr//,1]->[127], "qr// should extend the stack properly"); + |