summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/arybase/arybase.xs4
-rw-r--r--ext/arybase/t/lslice.t3
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/arybase/arybase.xs b/ext/arybase/arybase.xs
index 296733a7cc..68b9cf99cc 100644
--- a/ext/arybase/arybase.xs
+++ b/ext/arybase/arybase.xs
@@ -245,8 +245,8 @@ static OP *ab_pp_basearg(pTHX) {
count = SP-firstp;
break;
case OP_LSLICE:
- firstp = PL_stack_base + *(PL_markstack_ptr-2)+1;
- count = TOPMARK - *(PL_markstack_ptr-2);
+ firstp = PL_stack_base + *(PL_markstack_ptr-1)+1;
+ count = TOPMARK - *(PL_markstack_ptr-1);
if (GIMME != G_ARRAY) {
firstp += count-1;
count = 1;
diff --git a/ext/arybase/t/lslice.t b/ext/arybase/t/lslice.t
index c012b84f5e..0db7a078f2 100644
--- a/ext/arybase/t/lslice.t
+++ b/ext/arybase/t/lslice.t
@@ -1,7 +1,7 @@
use warnings; no warnings 'deprecated';
use strict;
-use Test::More tests => 11;
+use Test::More tests => 12;
our @i4 = (3, 5, 3, 5);
@@ -11,6 +11,7 @@ is_deeply [ scalar qw(a b c d e f)[3,4] ], [ qw(b) ];
is_deeply [ qw(a b c d e f)[3,4,8,9] ], [ qw(a b f), undef ];
is_deeply [ scalar qw(a b c d e f)[@i4] ], [ qw(c) ];
is_deeply [ qw(a b c d e f)[@i4] ], [ qw(a c a c) ];
+is_deeply [ 3, 4, qw(a b c d e f)[@i4] ], [ 3, 4, qw(a c a c) ];
is_deeply [ qw(a b c d e f)[-1,-2] ], [ qw(f e) ];
is_deeply [ qw(a b c d e f)[2,1] ], [ qw(f e) ];