Don’t crash when undefining handle of active format
format FOO =
@
undef *STDOUT
.
$~ = FOO;
write
Commit
7ef822cddfe9 began the work by putting in a null check and a
goto (to bypass the top format), but the goto wentto some code that
lacked the null check. (It did actually fix the case of a IO with no
ofp, but not the case of a GV with no IO.) Interestingly, it added a
bad_ofp label, but did not add the code to goto it (an oversight?).
The unused bad_ofp label was commented out in commit
9cbac4c72b52.
There was already a check before
7ef822cddfe9 to see whether there was
an ofp, but only after the format scope has been popped.
This commit extends that check by making sure there is an io first.
It removes the commented-out bad_ofp label.