diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-01-18 19:16:55 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-01-18 21:29:02 -0800 |
commit | bfa371b621d09f1ad1e588c4feaaadf9f20dc1c9 (patch) | |
tree | ec84f892d7c6792ff958a56580c107835ad4a520 /pp_ctl.c | |
parent | f60e676307b23b6eadcbba505b4f71838fe212a2 (diff) | |
download | perl-bfa371b621d09f1ad1e588c4feaaadf9f20dc1c9.tar.gz |
[perl #119949] Stop undef *_, goto &sub from crashing
Commit 049bd5ffd62b fixed problems with the wrong @_ being visible
after *_ modification followed by goto. In so doing, it made it
possible for a null to be placed at the start of the target sub’s
pad, because it was not checking that the array it got from PL_defgv
was actually non-null. Simply adding the check makes everything work.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2932,8 +2932,10 @@ PP(pp_goto) /* also pp_dump */ to freed memory as the result of undef *_. So put it in the callee’s pad, donating our refer- ence count. */ - SvREFCNT_dec(PAD_SVl(0)); - PAD_SVl(0) = (SV *)(cx->blk_sub.argarray = arg); + if (arg) { + SvREFCNT_dec(PAD_SVl(0)); + PAD_SVl(0) = (SV *)(cx->blk_sub.argarray = arg); + } /* GvAV(PL_defgv) might have been modified on scope exit, so restore it. */ |