summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pad.c b/pad.c
index 779e6d6708..c4362af0d4 100644
--- a/pad.c
+++ b/pad.c
@@ -1516,8 +1516,9 @@ Perl_pad_swipe(pTHX_ PADOFFSET po, bool refadjust)
if (AvARRAY(PL_comppad) != PL_curpad)
Perl_croak(aTHX_ "panic: pad_swipe curpad, %p!=%p",
AvARRAY(PL_comppad), PL_curpad);
- if (!po)
- Perl_croak(aTHX_ "panic: pad_swipe po");
+ if (!po || ((SSize_t)po) > AvFILLp(PL_comppad))
+ Perl_croak(aTHX_ "panic: pad_swipe po=%ld, fill=%ld",
+ (long)po, (long)AvFILLp(PL_comppad));
DEBUG_X(PerlIO_printf(Perl_debug_log,
"Pad 0x%"UVxf"[0x%"UVxf"] swipe: %ld\n",