diff options
author | Tony Cook <tony@develop-help.com> | 2017-08-31 10:05:54 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2017-08-31 10:21:05 +1000 |
commit | 745e740c825d415f535852b90516127e64c24905 (patch) | |
tree | e885978953fc413d96f82acb216d8fb2ccdc672f /pp_hot.c | |
parent | 1f52e4c40f4c8f591df6917a490f208d081adb9e (diff) | |
download | perl-745e740c825d415f535852b90516127e64c24905.tar.gz |
(perl #128263) handle PL_last_in_gv being &PL_sv_undef
rv2gv will return &PL_sv_undef when it can't get a GV, previously
this could cause an assertion failure in mg.c
My original fix for this changed each op that deals with GVs for I/O
to set PL_last_in_gv to NULL if there was no io object in the GV, but
this changes other behaviour as noted by FatherC.
Also partly reverts 84ee769f, which unnecessarily did the same for
readline(), so now we're consistent.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -446,10 +446,7 @@ PP(pp_readline) PUTBACK; Perl_pp_rv2gv(aTHX); PL_last_in_gv = MUTABLE_GV(*PL_stack_sp--); - if (PL_last_in_gv == (GV *)&PL_sv_undef) - PL_last_in_gv = NULL; - else - assert(isGV_with_GP(PL_last_in_gv)); + assert((SV*)PL_last_in_gv == &PL_sv_undef || isGV_with_GP(PL_last_in_gv)); } } return do_readline(); |