Make Perl_sv_utf8_upgrade_flags tolerate PL_sv_undef
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 7 Jul 2004 17:48:29 +0000 (17:48 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 7 Jul 2004 17:48:29 +0000 (17:48 +0000)
as an argument.

p4raw-id: //depot/perl@23063

sv.c

diff --git a/sv.c b/sv.c
index 1cca051..df384e7 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3937,6 +3937,8 @@ Perl_sv_utf8_upgrade_flags(pTHX_ register SV *sv, I32 flags)
     U8 *s, *t, *e;
     int  hibit = 0;
 
+    if (sv == &PL_sv_undef)
+       return 0;
     if (!SvPOK(sv)) {
        STRLEN len = 0;
        (void) SvPV_force(sv,len);