Skip to content

Commit

Permalink
fix (*glob) = ()
Browse files Browse the repository at this point in the history
RT #130385

The new sv_set_undef() function added by me with v5.25.7-12-ge03e82a
didn't handle undeffing a glob correctly, and gave an assertion failure.

Fix it to behave more exactly like (sv_setsv(sv, &PL_sv_undef),
which it is documented as being identical to.
  • Loading branch information
iabyn committed Dec 25, 2016
1 parent 4ee2b8d commit 523e5ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4834,8 +4834,8 @@ Perl_sv_set_undef(pTHX_ SV *sv)
if (isGV_with_GP(sv))
Perl_ck_warner(aTHX_ packWARN(WARN_MISC),
"Undefined value assigned to typeglob");

SvOK_off(sv);
else
SvOK_off(sv);
}


Expand Down
3 changes: 3 additions & 0 deletions t/lib/warnings/sv
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,13 @@ Invalid conversion in sprintf: "%+2L\003" at - line 19.
# sv.c
use warnings 'misc' ;
*a = undef ;
(*c) = ();
no warnings 'misc' ;
*b = undef ;
(*d) = ();
EXPECT
Undefined value assigned to typeglob at - line 3.
Undefined value assigned to typeglob at - line 4.
########
# sv.c
use warnings 'numeric' ;
Expand Down

0 comments on commit 523e5ba

Please sign in to comment.