In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/523e5ba86c48932471bfe24c81d5c860ade5fb44?hp=4ee2b8db537d28b77d127a86307e426289e5c8b5>

- Log -----------------------------------------------------------------
commit 523e5ba86c48932471bfe24c81d5c860ade5fb44
Author: David Mitchell <[email protected]>
Date:   Sun Dec 25 12:14:10 2016 +0000

    fix (*glob) = ()
    
    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.
-----------------------------------------------------------------------

Summary of changes:
 sv.c              | 4 ++--
 t/lib/warnings/sv | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/sv.c b/sv.c
index 0382e961e7..e3026f7d33 100644
--- a/sv.c
+++ b/sv.c
@@ -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);
 }
 
 
diff --git a/t/lib/warnings/sv b/t/lib/warnings/sv
index ee0fdc2579..64f624c5ed 100644
--- a/t/lib/warnings/sv
+++ b/t/lib/warnings/sv
@@ -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' ;

--
Perl5 Master Repository

Reply via email to