This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: In sublex_push use multi_close to detect here-doc
[perl5.git] / pp_ctl.c
index 24a8cd6..7fd27f8 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2895,19 +2895,21 @@ PP(pp_goto) /* also pp_dump */
                OP* const retop = cx->blk_sub.retop;
                SV **newsp;
                I32 gimme;
-               const SSize_t items = AvFILLp(arg) + 1;
+               const SSize_t items = arg ? AvFILLp(arg) + 1 : 0;
                SV** mark;
 
                 PERL_UNUSED_VAR(newsp);
                 PERL_UNUSED_VAR(gimme);
 
                /* put GvAV(defgv) back onto stack */
-               EXTEND(SP, items+1); /* @_ could have been extended. */
-               Copy(AvARRAY(arg), SP + 1, items, SV*);
+               if (items) {
+                   EXTEND(SP, items+1); /* @_ could have been extended. */
+                   Copy(AvARRAY(arg), SP + 1, items, SV*);
+               }
                mark = SP;
                SP += items;
-               if (AvREAL(arg)) {
-                   I32 index;
+               if (items && AvREAL(arg)) {
+                   SSize_t index;
                    for (index=0; index<items; index++)
                        if (SP[-index])
                            SvREFCNT_inc_void_NN(sv_2mortal(SP[-index]));