summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pp.c3
-rw-r--r--t/op/repeat.t84
2 files changed, 85 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 5965f1adc0..77dddcb8b3 100644
--- a/pp.c
+++ b/pp.c
@@ -1694,7 +1694,8 @@ PP(pp_repeat)
else {
dTOPss;
ASSUME(MARK + 1 == SP);
- XPUSHs(sv);
+ MEXTEND(SP, 1);
+ PUSHs(sv);
MARK[1] = &PL_sv_undef;
}
SP = MARK + 2;
diff --git a/t/op/repeat.t b/t/op/repeat.t
index 978916689b..fa7ce06904 100644
--- a/t/op/repeat.t
+++ b/t/op/repeat.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc( '../lib' );
}
-plan(tests => 49);
+plan(tests => 50);
# compile time
@@ -192,3 +192,85 @@ fresh_perl_like(
eval q{() = (() or ((0) x 0)); 1};
is($@, "", "RT #130247");
+
+# yes, the newlines matter
+fresh_perl_is(<<'PERL', "", { stderr => 1 }, "(perl #133778) MARK mishandling");
+map{s[][];eval;0}<DATA>__END__
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+()x0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+PERL